Pic to PIc and PC USB how to?

Tag: usb , microcontroller , pic , pic18 Author: zhangzining005 Date: 2010-10-06

I want to make an application where PIC18F4550 send its internal eeprom data to the pc through usb. Also i want to use the same usb connector to download the data to another PIC18F4550 over usb.

How to use ex_usb_serial.c of ccs examples codes for this purpose . If anyone can give me the schematic and what to do on PC side. An early help in this regard will be highly appreciated.

Best Regards Dani

The PIC18 compiler comes with a USB library, you can use this to communicate with the PC. The USB library also supports OTG, what could be useful for target-target communiction.

Other Answer1

The PIC18F4550 can only work as a USB device - that means that it can only be connected to a USB host like a PC. You cannot connect two PIC18s to one another via USB. Only the PIC24s and PIC32s have a USB host capability. To do what you describe, you would need to take one of these controllers, but they don't have internal EEPROM. I have no experience with the CCS USB stack. Microchip offers a free USB stack as part of their "Application Framework" available here: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784 When installed, you will find lots of functional MPLAB IDE based projects for the PIC18F4550. I would suggest starting with the 'CDC Class'. This is the class under USB that appears as a 'COM' port, and can be treated in the same way on the PC side as an old, real hardware COM port by most terminal programs (teraTerm, Hyperterminal etc.) Using the CDC class, you can simply output test strings over the USB interface, and then display them using the above mentioned terminal programs. This eases you into getting USB up and running, without having to worry about writing PC code or your own USB drivers.

Other Answer2

You can also search for "pc usb projects" with Google... Use SVLIB_PIC18F24J50 v3.4.NET4x64.dll in VB.NET to download EEPROM or RAM to your PC via USB.I also suggest that you use PIC18F26J50 with larger RAM and EEPROM.