Tuesday, October 20, 2009

The Usbpicprog Project

When I heard a year or so ago that some of MicroChip's PIC controllers now support a USB connection. I was interested, especially since I have worked with some of the PIC's a number of years ago, notably the 16C84. Starting to search for information on the internet, I found the usbpicprog project on http://sourceforge.net/projects/usbpicprog. The web site of the project is at http://usbpicprog.org/

I don't particularly like pc board design and making, and have not really aquired those skills. I do like embedded programming and electronic design at schematic level. So I like to build things up stepwise on veroboard. Below is my usbpicprog, not complete, but doing the most important thing already - talking to the PC via USB! Actually, my interest in the project is not really for it as a PIC programmer (yes, as a side product), but to learn how to communicate with a device via usb.


usbpicprog on veroboard with bare necesities for usb comms

In general, the documentation on http://usbpicprog.org is very good, but as always with documentation written by programmers/designers, what is obvious to them is not always obvious to the reader. (Or put it down to me not reading properly!) The first thing not completely clear to me was, what the usbpigprog can do and what is the purpose of the different headers. The way I see it is:

1. USB Comms and self programming: The PIC can communicate with the software on the PC, you can program the firmware in the PIC, using only the 5V supplied via the USB cable, the voltage pump is not required for that.

2. Programming Header P1: The usbpicprog is an in ciruit PIC programmer, thus it can program another PIC on another board via Header P1. To do this, you need 12V, that is what the voltage pump is for. So if you just want to use the knowledge to build some other usb device, not a programmer, you might not need P1 or the voltage pump.

3. Self Programming Header P2: Note the firmware programming in (1) assumes the boot loader is already loaded in the 18F2550. If not, you need Header P2 and something like a JDM programmer to program in the boot loader. Otherwise, if say you have another PIC programmer in which you can plug the 18F2550 to program the boot loader, you might ommit Header P2, but note that you will then have to tie Pin 1 of the PIC Vpp to Vdd (5V) and put at least 2 pins for a jumper between ground and PGC_SELF, pin 27 of the PIC, to select between boot mode and normal mode.

I will try to explain here, in more details, everything I needed to do for the things I have already achieved and will hopefully achieve in future. I think he steps I take will be
  1. Building the JDM programmer, circuit shown on http://usbpicprog.org
  2. Building the bare necessities of the usbpicprog.
  3. Programming the boot loader using Winpic800.
  4. Driver installation and software installation on PC.
  5. Firmware programming.
  6. Completing the usbpicprog board.
  7. Building an external PIC board to use P1, fully testing the usbpicprog.

4 comments:

  1. Hi,

    I am also keen in building the JDM programmer to program the bootloader into PIC18F2550. Can you guide me where to get the bootloader?

    ReplyDelete
  2. Hi Anonymous,
    You almost had me there, I haven't worked on this for a while, but do intend to return to it.

    Just go to ths Sourceforge page of Usbpicprog, click on all files and then look in Firmware. E.g. the latest file firmware-0.4.1-beta.tar.gz contains the file you are looking for: boot1.0.hex

    ReplyDelete
  3. i cant do step 5 .. help plz. i burned the bootloader to pic .. now i got problems with firmware. plz tell exactly how u burned it to pic

    ReplyDelete
  4. Hi
    could i ask for the schematic of minimum parts for image above

    ReplyDelete