Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pic16f877 icsp

Status
Not open for further replies.

dak246

Member
This is a simple question, but I can't find the answer anywhere (the datasheet is curiously vague on this point). I understand the process of ICSP, I just don't know what pins I'm supposed to make connections to on the PIC other than MCLR. So just a quick list of what connection goes to what pin or a link to a resource on this would be great. Thanks alot.
 
I believe that you need to consult the individual datasheets. Because there is such a wide variety of parts and not all parts have a common set of I/O pins you need to check those datasheets.

--from the department of redundancy department
 
on the 877, it's pretty simple. RB.6 is clock (aka PGC), RB.7 is data (AKA PGD). on the PDIP 877, those are 39 and 40, respectively. you will have to identify the pins on your programmer's ICSP header. dont forget ground. If you need to power from the programmer (usually not recommended), hook up Vcc as well.

For low voltage programming, use RB.3 (PGM).

By the way, the datasheet calls this out pretty clearly on the pin diagrams. You probably just aren't familiar with the terminology.
 
Last edited:
philba said:
on the 877, it's pretty simple. RB.6 is clock (aka PGC), RB.7 is data (AKA PGD). on the PDIP 877, those are 39 and 40, respectively. you will have to identify the pins on your programmer's ICSP header. dont forget ground. If you need to power from the programmer (usually not recommended), hook up Vcc as well.

For low voltage programming, use RB.3 (PGM).

By the way, the datasheet calls this out pretty clearly on the pin diagrams. You probably just aren't familiar with the terminology.

Thanks thats exactly what I needed to know. I can sort of see what you mean now with the pin diagram. I just didn't know the PG* had somethin to do with programming.
 
you can run basic applications via the programmer but if you hook up an LED to your proto board you'll c it drags power down at times, when you have alot of electronics.

Use external supply but remember this, do not have 2 supplies at the same time, i.e. dont hav ur external 5v and programmer 5v's as it wont really like it and who knows what's going to happen.

You will need a simple switch on MCLR, with a pull up. MCLR needs to have 5V for the program to run (in external power mode)... and MCLR needs to be SOLELY connected to ICSP pin 3 for the programming to work, and i have found that even leaving the PULLUP to GND can cause programming to fail, so ive had to use 2 switches, and flick them OFF when i want to program, and flick them ON when i want it to run normally

(if the pullup is not there, then when u switch MCLR to OFF, the input is floating and can trigger the PIC on, so the pullup to GND (pull down really) ties MCLR to GROUND thus pic is SURELY OFF.
 
dak246 said:
This is a simple question, but I can't find the answer anywhere (the datasheet is curiously vague on this point). I understand the process of ICSP, I just don't know what pins I'm supposed to make connections to on the PIC other than MCLR. So just a quick list of what connection goes to what pin or a link to a resource on this would be great. Thanks alot.

Check the schematics on my site. Look in the user manual for Inchworm, and the main connections on the 16F877A are MCLR, RB7 (PGD) and RB6 (PGC)
 
suby786 said:
you can run basic applications via the programmer but if you hook up an LED to your proto board you'll c it drags power down at times, when you have alot of electronics.
this completely depends on your programmer. If it has a decent regulator, the power won't be dragged down. The key issue is the amount of current drawn by the target system. To be certain, calculate the target system's draw and then look at the your programmer's regulator circuit. take the input voltage Vin and subtract the regulator's output voltage Vout, probably 5V. Multiply this times the target current draw. That is the additional wattage the regulator will have to dissipate. W = Itarget * (Vin-Vout). Up to a couple hundred mW is probably ok, any more and I'd be concerned. You could put a heat sink on the regulator to support higher loads.

edit: note that if you are using a USB based programmer, simply don't power the target system from it.

Use external supply but remember this, do not have 2 supplies at the same time, i.e. dont hav ur external 5v and programmer 5v's as it wont really like it and who knows what's going to happen.
That means do not join the +V from the programmer with the +V from the power supply. Other than that, it's ok to use a seperate power supply while programming via ICSP.

You will need a simple switch on MCLR, with a pull up. MCLR needs to have 5V for the program to run (in external power mode)... and MCLR needs to be SOLELY connected to ICSP pin 3 for the programming to work, and i have found that even leaving the PULLUP to GND can cause programming to fail, so ive had to use 2 switches, and flick them OFF when i want to program, and flick them ON when i want it to run normally
Uh, sorry but I've never done this and have programmed a lot of PICs via ICSP. Just use a 4K7 or 10K pullup on /mclr and run /mclr to the ICSP header. I have never had a problem with that. With a 4K7 pullup, the programmer will see slightly over 1 mA from the pullup resistor. It would have to be a very poor programmer that could not overcome that pullup. don't bother with a switch.
 
Last edited:
that explains it, my resistance value is too low hence its not providied the proper effect.

Thanks phil...
 
Just a note....If you don't plan on using low voltage programming, which many ICSP programmers don't support, then you need to pull down RB3 (PGM)...otherwise if you do want LVP, pull it up.

Microchip has an ICSP application note that is very helpful. Just search Microchip.com documenation for In circuit serial programming and you should find it.
 
vortechs2k said:
Just a note....If you don't plan on using low voltage programming, which many ICSP programmers don't support, then you need to pull down RB3 (PGM)...otherwise if you do want LVP, pull it up.

Microchip has an ICSP application note that is very helpful. Just search Microchip.com documenation for In circuit serial programming and you should find it.

This doesn't matter as applying the high programming voltage will override the RB3 level.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top