12F629 PIC

P

Peter

Guest
Question to PIC gurus:

when I wanted to read/program a 12F629 for the first time with my very
simple PIC programmer, I couldn't.
I found out on my scope the PIC DATA pin was holding at about 2.5V even with
a 1.5K resistor pulling it to ground (and even lower at -5V).
As both CLOCK and DATA pins must be pulled down to ground (logic 0) and then
by rising MCLR to 13V to go in Progamming mode, no wonder it didn't work.
So I added a transistor as an open-collector driver to my programmer (I saw
this in other programmer designs) to pull-down more effectivly the DATA pin
to ground. The programmer now works flawlessly!

But I'm puzzled as I find nothing in the PIC data sheet stating that pin
needs a good (stronger than normal...) pull-down to set it to logic 0 for
Porgramming Mode.

A friend of mine tried its two programmers, a Willem programmer with CMOS
driver with no luck and another simpler one with TTL 7407 open-collector
driver with success.

So is is a normal behavior for the 12F629 ?
Could the chip be defective but... it work ok in run mode???


-- Peter --
 
On Thu, 20 May 2004 17:44:46 -0400, the renowned "Peter"
<peterm@wanad00.com> wrote:

Question to PIC gurus:

when I wanted to read/program a 12F629 for the first time with my very
simple PIC programmer, I couldn't.
I found out on my scope the PIC DATA pin was holding at about 2.5V even with
a 1.5K resistor pulling it to ground (and even lower at -5V).
As both CLOCK and DATA pins must be pulled down to ground (logic 0) and then
by rising MCLR to 13V to go in Progamming mode, no wonder it didn't work.
So I added a transistor as an open-collector driver to my programmer (I saw
this in other programmer designs) to pull-down more effectivly the DATA pin
to ground. The programmer now works flawlessly!

But I'm puzzled as I find nothing in the PIC data sheet stating that pin
needs a good (stronger than normal...) pull-down to set it to logic 0 for
Porgramming Mode.

A friend of mine tried its two programmers, a Willem programmer with CMOS
driver with no luck and another simpler one with TTL 7407 open-collector
driver with success.

So is is a normal behavior for the 12F629 ?
Could the chip be defective but... it work ok in run mode???
Yes, the protection diode to Vdd could be damaged. Why don't you try
another part? That's considerably more than the maximum weak pullup
current, even if that was enabled for some reason.

Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
 
Question to PIC gurus:

when I wanted to read/program a 12F629 for the first time with my very
simple PIC programmer, I couldn't.
I found out on my scope the PIC DATA pin was holding at about 2.5V even
with
a 1.5K resistor pulling it to ground (and even lower at -5V).
As both CLOCK and DATA pins must be pulled down to ground (logic 0) and
then
by rising MCLR to 13V to go in Progamming mode, no wonder it didn't work.
So I added a transistor as an open-collector driver to my programmer (I
saw
this in other programmer designs) to pull-down more effectivly the DATA
pin
to ground. The programmer now works flawlessly!

But I'm puzzled as I find nothing in the PIC data sheet stating that pin
needs a good (stronger than normal...) pull-down to set it to logic 0 for
Porgramming Mode.

A friend of mine tried its two programmers, a Willem programmer with CMOS
driver with no luck and another simpler one with TTL 7407 open-collector
driver with success.

So is is a normal behavior for the 12F629 ?
Could the chip be defective but... it work ok in run mode???

Yes, the protection diode to Vdd could be damaged. Why don't you try
another part? That's considerably more than the maximum weak pullup
current, even if that was enabled for some reason.

Best regards,
Spehro Pefhany
Yes, it is indeed the best way to know and I will do it as soon as I get my
hand on another 12F629.

However, consider what I just found out yesterday... few hours after I
posted my first message:

I found out the PIC "behaves" that way only when a particular program is
loaded. This program was already in the chip when I got it. I have no
details about that program, the PIC was in a communication device.
If I bulk-erase the chip or write my own program in the chip, the DATA pin
is ok. Even if I use the same fuses, bandgap and oscillator settings.

--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers:
http://www.trexon.com
Embedded software/hardware/analog Info for designers:
http://www.speff.com
 
"Peter" wrote in message news:7lkrc.51642$Q6.584371@weber.videotron.net...
Yes, it is indeed the best way to know and I will do it as soon as I get
my
hand on another 12F629.

However, consider what I just found out yesterday... few hours after I
posted my first message:

I found out the PIC "behaves" that way only when a particular program is
loaded. This program was already in the chip when I got it. I have no
details about that program, the PIC was in a communication device.
If I bulk-erase the chip or write my own program in the chip, the DATA pin
is ok. Even if I use the same fuses, bandgap and oscillator settings.
Does your programmer follow the programming specification and pull MCLR to
12V before applying 5V to Vdd? My guess is that it is applying Vdd before
raising MCLR, which is the normal procedure for many other PICs.

The PIC12F629 has the option to enable an internal RC oscillator and disable
the external MCLR pin (use it as a general purpose input pin). As such,
when the programmer applies Vdd, the PIC goes on its jolly way executing the
code that was programmed into it with no regards to what MCLR is driven to.
It appears that the code inside it may be executing and wants to drive the
GP0/ICSPDAT pin high, which is why your pull down resistor is insufficient.
By putting a buffer on it, your are forcing the pin low. You may exceed the
25mA of maximum source current allowed by the specification by doing this,
so you should try to minimize the time between forcing the pin low and
pulling MCLR to 12V. Naturally, keeping Vdd low until MCLR is raised to 12V
would prevent the code from ever executing and this problem occuring.

One thing that wonders me is why a 1.5k pull down resistor would cause about
2.5V to appear at the pin. That means the pin is sourcing about 1.7mA,
which is way less than the PIC is capable of when being driven and way more
than one would expect from the weak pull up which is characterized as
sourcing a maximum of 400uA. Is your Vdd a stiff 5V, or is it sagging to
about 2.5V as well?

Howard Henry Schlunder
 
"Howard Henry Schlunder" <howard_hs@yahoo.com> a écrit dans le message de
news:2h68gjF9c1cvU1@uni-berlin.de...
"Peter" wrote in message news:7lkrc.51642$Q6.584371@weber.videotron.net...
Yes, it is indeed the best way to know and I will do it as soon as I get
my
hand on another 12F629.

However, consider what I just found out yesterday... few hours after I
posted my first message:

I found out the PIC "behaves" that way only when a particular program is
loaded. This program was already in the chip when I got it. I have no
details about that program, the PIC was in a communication device.
If I bulk-erase the chip or write my own program in the chip, the DATA
pin
is ok. Even if I use the same fuses, bandgap and oscillator settings.

Does your programmer follow the programming specification and pull MCLR to
12V before applying 5V to Vdd? My guess is that it is applying Vdd before
raising MCLR, which is the normal procedure for many other PICs.

The PIC12F629 has the option to enable an internal RC oscillator and
disable
the external MCLR pin (use it as a general purpose input pin). As such,
when the programmer applies Vdd, the PIC goes on its jolly way executing
the
code that was programmed into it with no regards to what MCLR is driven
to.
It appears that the code inside it may be executing and wants to drive the
GP0/ICSPDAT pin high, which is why your pull down resistor is
insufficient.
By putting a buffer on it, your are forcing the pin low. You may exceed
the
25mA of maximum source current allowed by the specification by doing this,
so you should try to minimize the time between forcing the pin low and
pulling MCLR to 12V. Naturally, keeping Vdd low until MCLR is raised to
12V
would prevent the code from ever executing and this problem occuring.

One thing that wonders me is why a 1.5k pull down resistor would cause
about
2.5V to appear at the pin. That means the pin is sourcing about 1.7mA,
which is way less than the PIC is capable of when being driven and way
more
than one would expect from the weak pull up which is characterized as
sourcing a maximum of 400uA. Is your Vdd a stiff 5V, or is it sagging to
about 2.5V as well?

Howard Henry Schlunder
You're quite right. My programmer does not control Vcc so it always on. So I
cheated, forced Vpp manually before Vdd and the DATA pin behaved normally.

I said the DATA pin got 2.5V with a 1K5 to ground... with a voltmeter. I
should've used my scope all along, it is a 74Hz 70% duty cycle square wave,
and only present when the CLOCK pin is pulled to ground. This explained the
weird 2.5V voltage I was reading with the voltmeter.
Obviously a program is running. Now everything is clear!

Thanks for your insight!

-- Peter --
 

Welcome to EDABoard.com

Sponsor

Back
Top