Wednesday, 10 March 2010
 
  Home arrow PIC arrow USB arrow 18F4550 USB Interface  
Main Menu
Home
Car PC
PIC
Electronics
Brewing
Links
FAQs
Forums
eXtplorer
18F4550 USB Interface PDF Print E-mail
Written by Evan   
Sunday, 06 August 2006
Article Index
18F4550 USB Interface
Page 2 - Burning in the Bootloader
Page 3 - USBDemo PIC Firmware and C# Software
Page 4 - Understanding the Demo Firmware
 

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. 



Last Updated ( Monday, 02 June 2008 )
 
< Prev
Partner Site
Visit my friends over at Dream-Technology, producing radio controlled and switch adapted toys for children with physical disabilities.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.
For usage outside the terms of this license, contact me by email to discuss.

© 2010 eegeek.net
Joomla! is Free Software released under the GNU/GPL License.

Get The Best Free Joomla Templates at www.joomla-templates.com