|
Page 3 of 4 The demo firmware I have put together for this article is built from the microchip example code from MCHPFSUSB. For the purposes of this article, you don't necessarily need to examine and understand the code; there's certainly a lot there to understand. For more information on it, I suggest you later check out my Understanding the Microchip USB Firmware article. I will give more useful information regarding the firmware later in the article. Right now, all you need to do is use the bootloader software to load the demo firmware into the PIC. Open the hex file, which is in the PIC Firmware folder of the code package for this article, and press "Program". If all is well, and you see a 'Write succeeded', then you can move on. If the write fails, reset the board and try again. If all else fails, try the bootloader application PDFSUSB, included in the MCHPFSUSB package from Microchip, it may be more reliable than mine. Once you have the firmware loaded, you can reset the board to begin executing it. When you do this, windows is going to see it as a different device, so it's going to ask you for drivers again the first time. Just give it the same driver as before. Now that the device is running the demo code and has been recognized by windows, you're ready to open up the demo software and test it out. The executable file is in C# Demo Software\USBDemo\bin\Debug in the code package. Run it, and you should see the following:
Checking the boxes and pressing the first button will allow you to set the states of LEDs #3 and 4 connected to the PIC (the two that aren't constantly flashing). The other example, the counter, counts a value from 0 to 255 by sending it to the PIC, which increments it and sends it back, demonstrating useful two-way communication. Please note that the speed at which it counts is not representative of the real maximum possible throughput rate, such as the software overhead with such small packets, and the default interrupt transfer interval of the PIC.
|