Proton BASIC Compiler - USB HID Descriptor wizard


  • PicŪ Basic


  • USB HID Descriptor wizard

    Note to all users.

    Since I seem not to be able to connect to the file server I'm stuffing all my tools on my own website.
    Please keep track of the forum, "Third party developments>hadv215's feedback forum".

    This tool now is version 2.1.1, main changes can be found in the forum.

    Please read the documentation!
    Leave your remarks, questions and bugs in my forum.

    Regards,
    Harm

    Version 1.5.0
    In recent versions (3.5.5.x) a new USB stack has been implemented that is supported by the compiler.
    There are, at this moment, two versions of the new USB Stack:
    1: In the download of the Updates tab
    2: In the directory '{UserName}\PDS\Samples\New Samples\Proton_USB_HID_Stack'
    I prefer the first since I was not able to create a working device from the second

    Both contain a number of files that are not yet supported by the compiler, but show an interesting approach.
    Since the files created by the good old EasyHID are not supported anymore by the compiler I decided to build a Wizard that will create a USB HID Descriptor.inc.

    Basically a USB Descriptor is a file containing a number of enties of which some may be of interest to be filled in by the user. These entries are of course the VID and PID, the Manufacturer, Product name, Serial number, Device version, Bus power and Buffer size. There are a number of other selections to be made too, specific for this implementation of the USB stack. These are Self Powered (vs Bus Powered), Number of Endpoints, Endpoint polling interval and the use of Timer1 to support interrupt driven USB operation.

    If you fill in all fields/select your options a descriptor file will be generated when you click 'Generate'.

    A second feature of this tool is to help you configure the fuses that relate to USB.
    When you select a Device a form is showed that contains all fuses that are related to USB operation.


    The first step is to select the Oscillator speed, since this will determine, for a large deal, the PLL settings and, depending on the device family, USB settings.
    The second step is to select the Oscillator mode. This allows you the choice of Oscillator modes that match the selected Oscillator speed.
    The final step is to select the CPU setting that determines the system clock. Selecting a value will determine what value you should give to 'Xtal' in your program.

    When you choose to configure these fuses, not only a descriptor file will be created, but also a 'skeleton' .bas file holding the Config values you selected.
    The first thing you have to do to use the 'new' USB_HID_Stack' is to copy, not move, all files from the that directory to your project directory since the compiler won't look in the samples directory.
    Now please notice that a .bas file may have only one set of Config_start...Config_end sections.
    The new stack contains a file called USB_defs.inc that already contains Config settings for a number of devices.
    So, to avoid conflicts, the 'Config section' in the skeleton .bas file is 'commented out'.
    You have two options:
    1) Load USB_defs.inc in a text editor, comment the 'Config section' and save it to use the skeleton .bas
    2) Leave commented 'Config section' in the generated 'skeleton' .bas file if you're happy with the USB_defs.inc

    The zip containing the executable
    The pdf containing the documentation

    Fixes
    1.3.3:
    - The tool is now single instance.
    - The error message that showed when the tool was first run is now gone.
    - The 'Config' section in the skeleton .bas file is now comment.
    - 4550 family corrected:
    -- oscillator selections updated to reflect oscillator speed correctly
    -- Xtal now reflects CPU setting correctly

    Additions
    1.4.0:
    I added a preferences form.
    - You can now enter your default VID and Manufacturer
    - The Config lines will now be picked up by JohnGB's Fuse Configurator.
  • Recent Activity

    GAMBOA-387

    PPS for 8bit Microchip Micocontrollers

    Thread Starter: evan

    I am not sure of the applicability of the software discussed but I thought I would share a piece of software that we use in 'another place'. The...

    GAMBOA Today, 15:46 Go to last post