Notes about the hardware
*I don't own the original USB Blaster, only a clone. My device may do things differently from the original.*
The original USB Blaster is based on some FTDI chip. There are clones with a lot of different designs. Mine uses some USB-enabled 8051 microcontroller. This doesn't matter much, as they are clones, they should behave the same.
The protocol used by the USB Blaster is quite well known, so I'm not going to repeat all of it.
The USB blaster does not power the device being programmed. Instead, it relies on the device to provide a power supply, and the output signals will match the voltage.
The ICSP protocol requires the data line to be bidirectional. The USB Blaster does not allow that. So we have to tie one output and one input pin on the same data pin to be able to read and write, likely adding some resistors in the mix.
The connector pinout is as follows:
1 3 5 7 9 2 4 6 8 A
- 1 - PGC (TCK)
- 2 - GND
- 3 - PGD in (TDO)
- 4 - VCC
- 5 - MCLR and PGM (TMS)
- 6 - (N/C)
- 7 - (N/C)
- 8 - (N/C)
- 9 - PGD out (TDI)
- A - GND
The software is based on libftdi to send data to the device. There is nothing really complicated (yet).
Things to think about
- Is it possible to use the stream mode of the blaster to send the clock pulses ? Is it useful ?
- Is the clock rate ok for the PIC ? Can it be set ?