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.

ICSP Programming 16F877A w/ Velleman Programmer

Status
Not open for further replies.

bytter

New Member
Hi there,

I've bought the Velleman programmer for learning PIC programming. I've successfully played w/ a PIC16F628A. Now I want to do something advanced and got myself a 16F877A. I've tried using the ICSP port on the programmer to connect to the PIC on a breadboard, but all I can read from it is 3FFF (except for the Device-ID that reads 3DCC). I'm unable to write anything.

I'm connecting the following way:

ICSP PIN -> PIC
1 - 1
2 - 11
3 - 12
4 - 40
5 - 39

I'm also shorting PIC PINs 11 to 32 and 12 to 31.

Can anyone please help me? Is there something missing? Is the oscilator needed to program it?

Thanks..

Hugo Ferreira
 
can you program the chip in the programmer?

I don't know the velleman programmer but you should verify the ICSP pin connections (make sure that 1 is /mclr, 2 is +5V, 3 gnd, 4 data, 5 clock.

Is this a brand new chip or has it been programmed before?
what programmer software are you using?
 
Hi there,

Is the Pic powered up?

If so +5v dosn't need to be connected.

All you need to do is make a common ground and connect RB6, RB7 to the corrosponding Clock & Data lines from the programmer along with Mclr Pin1.

All the best

Pete..
 
Heya there,

This is a brand new chip. I've completly isolated the chip on a breadboard, whithout any kind of power. So there's nothing connected to it except the wires that come from ICSP.

I can program a 16F627 and 16F628A using the provided sockets. I will experiment programming a 16F628A using the ICSP...

Here's the assembly manual of the Velleman's programmer where the schematics are shown (**broken link removed**.

Could the chip be damaged?

Thx!

Hugo Ferreira
 
the failure rate of new PICs is really low - so much to the point that it is very unlikely you got a bad one.

make sure you are programming an 877A with 877A settings in the programmer. the non-A version uses a different programming algorithm and will fail to program if using 877A settings.

You didn't forget to switch SW5a to program, did you?
 
Ehhe, no, SW5 is set to PGM mode :D
I've tried connecting PIN36 to GND, but same result (isn't it only needed to LVP?). I've updated the ProgPic2 to version 2.6, which supports the A version of 877, but got the same results.

Looking at the diagrams, does anybody know if it is possible to use any other software with this board?
 
bytter said:
Ehhe, no, SW5 is set to PGM mode :D

Check if the following also applies to you.

One previous user has the problem with SW5 because he didn't notice that it is a 3-position switch.
 
Not the case. I know SW5 is a 3-position switch.
LEt's make a quick summary:

a) I'm able to read, write, run PICs using the in-board sockets.
b) I'm unable to write 16F877A using the ICSP provided by the board. Everything I read comes as 3FFF, and the EEPROM is filled with FF. Erasing both code and memory return a success.

Can anyone point me out to a home-made programmer that works with a Prolific USB-To-Serial cable, so I can try make it and test with the 16F877A?

Cheers!

Hugo Ferreira
 
Well... The model is in the combo-box ;) And yes, there is a seperate (A), since the programming mode is different...
 
FYI ,the oscillator is not needed to program the pic.
if you are getting all ones it may be the 16F877A is not getting power.
verify that 5V is getting to Vdd and while you are at it verify that ground is connected also
whith the board completly dissconnected from power and the PC, and using your ohmmeter , check that the MCLR pin on any of the sockets is comming out to the Mclr at the end of the cable.
also check the other RB7, RB6 , Vdd and Vss in the same manner
if nothing shows up strange then i dont know ..
good luck.

EDIT spelling errors
 
Last edited:
bytter said:
but all I can read from it is 3FFF (except for the Device-ID that reads 3DCC).

The device code for 16F877A is 0E2X (X=0-F) so in your case the device code is read wrong.

This led me to believe that the PIC has not entered programming mode.

From the schematic diagram, the 13V Vpp applies to PIC MCLR pin via a 3K3 resistor, bypassed to VSS using T4 BC547 when PIC is not being accessed. You should check to see T4 and 3K3 resistor are in good condition by measuring the MCLR voltage when not doing any PIC operation. The voltage should be zero. In READ mode, you should get close to 13V on MCLR.
 
bytter said:
Hi there,

I've bought the Velleman programmer for learning PIC programming. I've successfully played w/ a PIC16F628A. Now I want to do something advanced and got myself a 16F877A. I've tried using the ICSP port on the programmer to connect to the PIC on a breadboard, but all I can read from it is 3FFF (except for the Device-ID that reads 3DCC). I'm unable to write anything.

I'm connecting the following way:

ICSP PIN -> PIC
1 - 1
2 - 11
3 - 12
4 - 40
5 - 39

I'm also shorting PIC PINs 11 to 32 and 12 to 31.

Can anyone please help me? Is there something missing? Is the oscilator needed to program it?

Thanks..

Hugo Ferreira


I'm using the same K8048 programmer.
I'm trying to program the 16f877A with a linux program.

I had the same problem as you described.

:D My solution was to shorten the ICSP wires to the 16f877A to aprox. 20 cm.
AND apply a 150 pF condensator from the RB7/PGD wire to ground
AND apply a 100 ohm resistor in the RB6/PGC wire with a 150 pF condensator at the chip side of the resistor to ground (low pass filtering PGC)
I mounted the R and C's on my bradboard as close to the chip pins as possible.
Furthermore in case of a brand new 16f877A (LVP is enabled by default) connect pins 36 RB3/16PGM and 38 RB5/18PGM to ground with two 10k resistors.
This is necessary only at first time HV programming. Put LVP_off in the config word and disable code protection in the config word.


Now I am able to identify and program the 16F877A with K8048 ICSP.
Verifying the programmed 16f877A still gives problems (not at all locations in pic program memory) but this is probably a bug in the linux programming software.
I'm using this software:

**broken link removed**

I will try the solution with the Velleman software under windows XP as soon as possible.

Connect pins 11 and 32 to Vdd (+5V)
Connect pins 12 and 31 to Vss (gnd)
I suppose that is wat you means with:
I'm also shorting PIC PINs 11 to 32 and 12 to 31.

grtz
Arnoud
 
Hi!

First, thanks for all the help you guys have been providing.
When not doing any operation (i.e, SW5 is set to standby), the MCLR pin is set at 0v. When SW5 is set to PGM, the MCLR pin raises to 12.79v.

Also, in standby, VDD is at 0v, and both PGC and PGD are at 5v. In PGM mode, VDD, PGC and PGD are read at 5v.

So.... IC broken? :D

Cheers!

Hugo Ferreira
 
ICSP PIN -> PIC
1 - 1
2 - 11
3 - 12
4 - 40
5 - 39

Connect 2 to pins 11 and 32 of pic.
Connect pin 3 to pins 12 and 31 of pic.

No external power supply to the pic or see PIC16F87XA datasheet for schematics.

Also, in standby, VDD is at 0v, and both PGC and PGD are at 5v. In PGM mode, VDD, PGC and PGD are read at 5v.

K8048 should keep PGC and PGD to GND at start of PGM mode.
This to get the chip in programming mode (Vpp to MCLR after RB6 and RB7 are Lo).

I think maybe you have a serial port problem.
What is your computer configuration? (e.g. real PCI RS232 port or laptop and USB convertor)

grtz
Arnoud
 
Eagledream said:
Connect 2 to pins 11 and 32 of pic.
Connect pin 3 to pins 12 and 31 of pic.

Already tried that, as I said in the first post :(

I've tried two different computers. One, my laptop, with a Prolific USB-To-Serial adapter. The other one, my desktop, with a true serial port. Both are able to program in-board PICs. Both fail the same way with the ICSP mode to 16F877A.

I guess I need to get myself a similar chip to find out if this one is broken :(

Cheers,

Hugo
 
Since you are convinced the 877A is bad , i dont suppose you have tried to use another chip ,and try to program that using the ICSP cable?
 
Eagledream said:
I'm using the same K8048 programmer.
I'm trying to program the 16f877A with a linux program.

I had the same problem as you described.

Hey, I haven't noticed your reply :|
I'll try your solution ASAP. I'll post any progress here...

BTW, would you care to explain why are all those components necessary ;)

Thx,

Hugo Ferreira
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top