Icsp
Icsp
Programming a big DIP (through hole) chip is easy. Pop it into a socketed
programmer, burn, and return to the application circuit. Test and repeat.
Things get more difficult with smaller (surface mount) chips. There are no
standard sockets for QFN, SSOP, QFP, or even the large SOIC .300 packages.
There are really expensive ($100s) clips that can attach to, and program, these
chips. A different clip is needed for each chip type and pin count you use.
There is an alternative. Its called ICSP.
ICSP means 'in circuit serial programmer(ing?)'. It is a way of programming a PIC
while it is still attached to the application circuit. Thats right, no more chip
swapping.
Why ICSP?
1. There are no programming sockets for small package chips. Clips are
expensive.
2. Its a pain to move chips in & out of the programmer during development.
Impossible for surface mount parts.
volts are placed on the MCLR/Vpp pin (usually pin 1 on modern PICs, more on
that below).
Clock/Data or PGC/PGD The clock and data lines are used to write and read the
PIC firmware. These are usually the same pins as PORTB6 & PORTB7.
Exercise: Identify the ICSP connection points on the PICs in the pictures below.
If the PIC fits, wear it.
I get a lot of questions about my JDM2 design on instructables. The most
frequent is "Will it program PIC X?'"' - here is how you can tell:
1) Look at the data sheet. Find the 'Pin Diagram' that looks something like the
picture below.
2) Identify the location of the pins that must be connected for programming (Vpp,
Vdd, Vss, Data, & Clock).
3) Look at the socket connection on the programmer. Can you match the
required pins with a socket on the programmer?
Depending on your design, you can now make all the required connections and
program your PIC. There are a few catches that you should know about. Design
for ICSP is important. Microchip provides a nice PDF application note about
designing for ICSP.
http://www.microchip.com/stellent/idcplg?
IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011744
Here are some tips and examples of ICSP designs from my previous
instructables.
for ICSP by sticking wires into the DIP sockets and connecting them to the target
PIC.
*****JDM2s use funky voltages...connect it to the circuit WITHOUT external
power (or even ground) connected to the application circuit. Remove the ICSP
connections before applying power. Failure to do this is not destructive, but will
result in failed programming*******
Another option is a (semi-)proper ICD programmer. ICD allows you to control
firmware execution on your PIC by setting break points in the code or reading out
memory and port values. An ICD can also animate the execution of code, power
the application circuit, and program the PIC. It does all this through the same 5
pin ICSP connection we have discussed. Several ICSP clones that you can make
yourself can be seen here: http://www.icd2clone.com/wiki/Main_Page. I built the
PiCS (rev B) a few months ago and love