USB Pic flash programmer

The Goal

To program a 15bit parrallel address and data flash chip over USB for use in my third year project.

The Solution

Use a Microchip Pic 18F4550 for USB access and control and hook it into a Am29F010B flash chip which has internal charge pumps to make the electrical supply side really easy - and that's it! To make it easy to use with standard PC software the PIC appears as a CDC serial device (based on the Microchip MCHPUSB firmware) and you transfer files to it using XModem.

18F4550 Flash programmer schematic USB Pic flash programmer


The code which is running on the PIC is available here. To use it, assemble the circuit then compile that code with the Microchip C18 compiler. Download the code into the PIC then plug the USB from the PIC into a PC. If the PC runs windows use the MCHPUSB drivers available from Microchip. For linux it is very important to prevent the cdc-acm driver from loading as it bombs out constantly (add blacklist cdc-acm to /etc/modprobe.d/blacklist). Instead, load the usbserial driver with:

modprobe usbserial vendor=0x04d8 product=0x000a
(as root). EDIT: This appears no longer necessary with Ubuntu 7.10 Then connect to the device with Hyperterminal, Minicom, Kermit etc.

Once connected to the device with a serial link, characters sent to the PIC will be passed on out of the Rx/Tx serial port of the PIC (this is to provide a terminal connection to the embedded computer in my third year project.) To initiate a file transfer to the pic, type DL then start an XModem transfer. To receive data from the PIC, type DS then start an XModem receive. When receiving data, you will always get a complete dump of the RAM (64K) - if necessary, the data will be padded with 0xFF. If nothing works, adding

to user.c will cause many debug messages to be put out of the PICs normal serial port - use a MAX233 or similiar to level shift this data up to PC serial port compatible levels.


I would like to thank:

  • Microchip for sending me the PIC on sample.
  • for a great schematic for basic 18F4550 PIC operation.
  • Jeff for lending me his PIC programmer when mine died!

Posted on 03 Apr 2007
With thanks to