Preprogrammed Firmware
©
2009 Microchip Technology Inc.
DS51806A-page 18
FIGURE 3-2:
HID DEMO APPLICATION
The demo PC application provides a simple graphical user interface for sending and
receiving small amounts of example data to and from the HID interface on the USB
device. Full source code for both this PC application and the demo firmware are
included in the MCHPFSUSB Framework. Assuming the MCHPFSUSB Framework
has been installed in the default location, the source code for both the firmware and PC
application are found in the following directory:
C:\Microchip Solutions\USB Device - Composite - HID + MSD
The demo PC application can be used to toggle the LEDs on the demo board,
determine the RB2 push button state and measure the analog voltage on the micro-
controller’s RA0 I/O pin. The analog voltage on RA0 is measured by the ADC of the
microcontroller and graphically displayed by the “ANx/POT Voltage” bar, as shown in
Figure 3-2.
If the PIC18F46J50 Full-Speed USB Demonstration Board is used as a stand-alone
device, it is recommended that an adjustable external power supply (between 0V and
3.3V) be attached to the RA0 pin to provide a more interesting demo experience. If the
board is used in conjunction with the PIC18 Explorer Board or the PICDEM HPC
Explorer Board, the analog potentiometer on those boards, tied to RA0, can be
adjusted to alter the HID demo’s voltage display bar.
3.3
USING THE HID BOOTLOADER FIRMWARE
The PIC18F46J50 Full-Speed USB Demonstration Board is preprogrammed with HID
class USB bootloader firmware as well as the USB composite HID+MSD demo firmware.
The HID bootloader is independent of the composite HID+MSD demo firmware.
The bootloader firmware can be used to update the Flash memory contents of the
PIC18F46J50 microcontroller, similar to using a dedicated ICSP based programmer.
When the bootloader is used, a new
.hex
file can be programmed into the device by
sending it directly over the USB cable to the PIC18F46J50.
The HID bootloader firmware uses self-programming operations to update the Flash
memory contents of the microcontroller.
To use the HID bootloader:
1.
Launch the HID bootloader application by selecting:
Start>Programs>Microchip>MCHPFSUSB v2.4>USB HID Bootloader.
The dialog box, shown in Figure 3-3, appears. (This dialog box appears when-
ever the USB device is not yet attached or the firmware is not in Bootloader
mode.)