In this thread, I'll post the information required to implement a USB interface using a PIC chip. For now, I'll keep it in the CDG section to give us an advantage, but will probably move it in the future to the public area.
USB offers at least two big benefits: an easy way to change the PIC code, and a way to pull data out.
Microchip sells several PICs with built-in USB hardware. I bought their 18F4550 demo board which you just plug into the PC, run the software, and *voila* it all works! That's the easy part. The hard part is figuring out how it all works, and how to make changes to do what you want it to do. They include source code for the firmware but, amazingly enough, not for the software.
So it was 2 weeks of near-full-time work figuring it all out. I'll skip the gory details.
The final chip I used is the 18F2455, which is a 28-pin SOIC version (4550 is a 44pin QFP). After pins for power, clock, MCLR, and USB, there are 20 GPIO pins left over. There is a 10-input 10b ADC and the usual array of comparators, timers, interrupts, and PWM.
Programming the PIC is done in 2 stages. First, using a stardard PIC programmer you load the "bootloader" firmware which is fairly small (~1000 bytes). You are done with the PIC programmer, and you can solder down the part. Then, the main firmware is loaded in over the USB, and can be done so repeatedly. Also, your firmware can poll the USB for data input, or send out data, as it is running.
That does it for the description. I will begin uploading the code details tomorrow.
- Carl
USB offers at least two big benefits: an easy way to change the PIC code, and a way to pull data out.
Microchip sells several PICs with built-in USB hardware. I bought their 18F4550 demo board which you just plug into the PC, run the software, and *voila* it all works! That's the easy part. The hard part is figuring out how it all works, and how to make changes to do what you want it to do. They include source code for the firmware but, amazingly enough, not for the software.
So it was 2 weeks of near-full-time work figuring it all out. I'll skip the gory details.
The final chip I used is the 18F2455, which is a 28-pin SOIC version (4550 is a 44pin QFP). After pins for power, clock, MCLR, and USB, there are 20 GPIO pins left over. There is a 10-input 10b ADC and the usual array of comparators, timers, interrupts, and PWM.
Programming the PIC is done in 2 stages. First, using a stardard PIC programmer you load the "bootloader" firmware which is fairly small (~1000 bytes). You are done with the PIC programmer, and you can solder down the part. Then, the main firmware is loaded in over the USB, and can be done so repeatedly. Also, your firmware can poll the USB for data input, or send out data, as it is running.
That does it for the description. I will begin uploading the code details tomorrow.
- Carl
Comment