My blog has moved to it's own domain!

You should be automatically redirected in 6 seconds. If not, visit
http://mad-laboratory.com
and update your bookmarks.

In Circuit Serial Programming

So, I learned a very valuable lesson this week with the PIC microcontrollers from Microchip. In Circuit Serial Programming, or ICSP. I don't know if this is available with other uCs or not, but I'm sure that they would have something similar to this. Please comment and let me know otherwise!!!!!

ICSP is where you can install your chip into your circuit but still be able to program it by using 5 wires (2 wires actually program it, but 3 others support it, Power, Gnd, etc). It's really cool because you can put the uC in the circuit you are ACTUALLY going to use and work with it instead of working with a breadboard, prototyping board etc. Below is a picture of exactly all that is needed in order to program any PIC microcontroller.

SETUP

In this setup I am using the PICKIT 2 programmer. I am using the standard software that comes with the PICKIT 2 to load the hex file into the chip. The chip is the PIC16F690. I am writing code in the Proton+ Development Suite.

The wiring is really simple. You just need a pin 5 header, a PIC microcontroller, and a breadboard. The wiring is specific to this microcontroller, but probably will work for a number of different microcontrollers. See your specific datasheet for details on how to wire up your own microcontroller.

Wiring:
PICKIT2 - PIC16F690
Pin 1 - Pin 4
Pin 2 - Pin 1
Pin 3 - Pin 20
Pin 4 - Pin 19
Pin 5 - Pin 18

**IMPORTANT NOTE**
It took me a number of hours to realize that the pinout on the PICKIT2 starts pin 1 position on the right and goes to the left. In the picture above note the arrow. That designates pin 1.

Results

After hooking up the PIC16F690 correctly it was really simple to load the hex files onto the microchip.

Conclusion

Using the ICSP is really simple, once the wiring is hooked up properly. I plan on including ICSP in all of my own circuits in order to update the software without needing to remove the uC.

It has been suggested that if you are giong to use the specified pins for ICSP to not use them for any other purpose even though it is possible.

0 comments: