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.

Error programming 16F628

Status
Not open for further replies.

gregmcc

Member
I have just build the P16PRO40 and am using WinICProg to program my
PIC.

I tried posting this message on the winicprog site but there seems to
be a problem with the registration process.

I have tried toggling the button in the hardware setting and I get the
following:

vpp on: MCLR = 12.85V
clock high: PGC = 4.9V
output high: PGD = 4.9V

I'm using the circuit from www.olimex.com/dev/pdf/pic-pg3 b.pdf

When I program the chip it fails on a verify. It does seem to program
something as the first few bytes are written although incorrect values.
I can then erase the device and reprogram it, and different bytes get
written to the start.

any idea where I can start looking? I've checked the supply voltage
with a scope and its stable.
 
gregmcc said:
vpp on: MCLR = 12.85V
clock high: PGC = 4.9V
output high: PGD = 4.9V

Are those numbers from the software or read on a multimeter?

Make sure you are actually getting those voltages on the board...

As the previous poster said, 12.85V might be a little low... Some PICs are less tolerant on this than others.

Good luck.
 
Exo said:
12.85V on mclr isn't enough, it should be well above 13V, 14V preferred.

Actually the spec is 12V, although many programmers aim for 13v, which is roughly the value I like to see.

The voltage reading 13V on a meter doesn't mean it's correct, if you're using an unregulated wallwart a meter may read 13V but the supply may have too much ripple on it, this prevents the PIC entering programming mode.

A simple test is feed the programmer from 18V DC, using a pair of 9V batteries in series, this prevents any ripple problems.

A more complex test is to use a scope on MCLR to check for ripple!.
 
Hi gergmcc,

Cannot access the link you have posted for the programmer. But I did after some editing.

I checked the circuit diagram and it seems OK with pulling PGM pin down to 0V when you place the PIC in the programming socket.

If you are programming the target PIC using an extension cable, please makes sure that Pin10 (PGM) of 16F628 is connected to 0V during HV programming as recommended by the Microchip programming Spec.

Software accessing directly the parallel port under WinXp or Win2000 might require additional driver to work properly.
 
Nigel Goodwin said:
Actually the spec is 12V, although many programmers aim for 13v, which is roughly the value I like to see.

I wonder why so many programmers use a little more then 12V, balancing on the edge of the spec...

I used a 7815 in my P16pro40, giving 15V for mclr !
I haven't got any problems with that...
 
But according to the Programming Spec of 16F628:

Min MCLR Vpp: Vdd + 3.5V = 8.5V
Max: 13.5V


I wonder why so many programmers use a little more then 12V, balancing on the edge of the spec...

Agree. A bit high. :D

Many PICs families have max. MCLR Vpp of 12.5V, (e.g. 18Fxxxx) so any voltage higher than 12.5V is out of specification. The use of 14V or higher is a carry over from past experience, I guess.
 
Exo said:
I used a 7815 in my P16pro40, giving 15V for mclr !
I haven't got any problems with that...

According to one PIC programming software author, not to mention Microchip's datasheets, you will encounter problems with newer PICs applying 15V on MCLR. Some PICs will not enter programming mode correctly, or might do so unreliably.

(I am still trying to find the link to back this up... more to come)
 
gregmcc said:
I have just build the P16PRO40 and am using WinICProg to program my
PIC.

I tried posting this message on the winicprog site but there seems to
be a problem with the registration process.

I have tried toggling the button in the hardware setting and I get the
following:

vpp on: MCLR = 12.85V
clock high: PGC = 4.9V
output high: PGD = 4.9V

I'm using the circuit from www.olimex.com/dev/pdf/pic-pg3 b.pdf

When I program the chip it fails on a verify. It does seem to program
something as the first few bytes are written although incorrect values.
I can then erase the device and reprogram it, and different bytes get
written to the start.

any idea where I can start looking? I've checked the supply voltage
with a scope and its stable.

I had a similar problem too with my first programmer. It turned out that the PIC was programmed half way with garbage data. What I did was I changed my Inverter IC and ... it worked !! At that time I felt either the Inverter was faulty (though I dont recall it was) or there was a timing limitation on the Inverter. I suspect your inverter has some timing problems too...asssuming everything in your circuit is correct..
 
Joel Rainville said:
Exo said:
I used a 7815 in my P16pro40, giving 15V for mclr !
I haven't got any problems with that...

According to one PIC programming software author, not to mention Microchip's datasheets, you will encounter problems with newer PICs applying 15V on MCLR. Some PICs will not enter programming mode correctly, or might do so unreliably.

(I am still trying to find the link to back this up... more to come)

I'm using 18F's with USB, there r pretty new devices and i have no problems...
I'm not saying you're wrong, i'm just saying 15V works for me ...
 
thanks for the all the replies.

i've checked the mclr with a scope. its now 13v with zero ripple. the main supply is from a dc power supply. pin 10 of the chip also connected to ground.

i haven't tried changing the inter yet though. any other tipds/tricks I can try? I'll get another inverter tomorrow and see if it makes any differnce.

for the schematic to the circuit i used try **broken link removed**

thanks
greg
 
one thing that comes to mind is, use very short and shielded cables between pc <-> programmer <-> pic...

using unshielded/long cables makes p16pro40 fail...
 
no, if it's a decent cable it should be fine

how is the pic connected to the programmer ?
in a socket (fine)
or with wires ? (should be VERY short)
 
ive built the circuit on veroboard and then used short wires to connect a socked to the board. the socket is then bounded on a plastic box.

is there anything in particular i should be looking for - the voltages seem to measure ok. and i've checked all the wiring. it just doesnt want to program. Ive just tried another pic - same problem.
 
The inverter has to be either 05,06 or 07 normal TTL version or LS version, others can't be use. These are open-collector inverter or buffer, don't substitute others.

Test the programmer and programming software without a PIC. Use your scope probe on PGC and PGD, then do a read from the software. Can you see pulses on these lines?

Does the Vpp LEDs lights up and stay ON during the read operation?

You kept mentioning the software as WinicProg which don't exist. Did you meant WinPicProg?
 
I've now tried another 74ls07 - same problem. I've also tried to redo all the wiring from the veroboard to the ic socket - the original wiring has been replaced with thicker wiring.

i've also checked the supply voltage and mclr with a scope - there's no ripple.

on the pgc and pgd lines there are pulses when i read and write to the pic. i'll check the vpp light, but i'm pretty sure it says on during the read. the weird thing is the first two bytes are always both written correctly. its just the rest of the data thats nonsense.

sorry - the software i used is winpicprog.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top