PDA

View Full Version : Weak pullups failing?



ardhuru
- 9th September 2006, 15:28
I have a 16F676, with a couple of switches on the port 'A'. I had enabled the internal weak pullups, and they seemed to be working fine. Until now...

The circuit started behaving very unexpectedly, till I noticed that the internal pullups did not seem to be doing their job; it was as if the switches were all permanently pressed. I confirmed this by using a fresh device, which worked perfect.

Now, I wonder how safe is it to rely on the inernal pullups? Is this likely to happen again? To be fair, this is the first time I've had a pic go bad in this particular fashion.

Regards,

Anand

sayzer
- 9th September 2006, 16:16
Did you disable comparators ?


----------------

ardhuru
- 9th September 2006, 16:30
Sure thing; as I mentioned, a fresh chip works flawlessly.

Regards,

Anand

sayzer
- 9th September 2006, 18:02
.....

Now, I wonder how safe is it to rely on the inernal pullups? .....

Anand



Check this post here:
http://www.picbasic.co.uk/forum/showthread.php?t=924&highlight=weak+pullups

Look especially at what Melanie says about Weak Pullups.


Regards.



----------

ardhuru
- 9th September 2006, 18:21
I've started sharing Steve's apprehensions about weak pullups after reading that thread.

Again, its the first time (and on the first device) after having used them many times in the past that this has happenned to me, but then if t *can* happen at all, maybe it would be safer to have external pullups.

Regards,

Anand

Melanie
- 9th September 2006, 19:54
There is no problem with weak pull-ups on switches...

How are you enabling them?

Apart from OPTION_REG you also have to set them in the WPUA register in this chip.

flotulopex
- 9th September 2006, 21:01
Reading the data sheet of my 16F88, I can't find the way how to enable pull-ups on PORTB one by one.

I don't understand what "latch" means (in french, latch is translated as a kind of lock)?

Bit 7 of OPTION_REG sais: "PORTB pull-ups are enabled by individual port latch values".

Does it that mean you have to enable the pull-ups for all PORTBs and then, if you'd like to disable it for one or another port, to set this port as an output?

There are no pull-ups for PORTA. Is this correct?

Dave
- 9th September 2006, 21:39
flotulopex, Yes that is correct. There are no pullups available for porta..

Dave Purola,
N8NTA

Melanie
- 9th September 2006, 21:50
OPTION_REG.7=0 will enable ALL PortB weak pull-up's for this PIC. You cannot enable or disable pull-up's on an individual basis on this device. You are correct that this PIC doesn't have pull-up's on PortA.

ardhuru
- 10th September 2006, 06:33
There is no problem with weak pull-ups on switches...

How are you enabling them?

Apart from OPTION_REG you also have to set them in the WPUA register in this chip.

Hi Melanie,

(this is a 16F676)
OPTION_REG.7 = 0 ' ENABLE WEAK PULLUPS
WPUA = 255 ' ALL PULLUPS ON

Since a fresh chip works flawlessly, I do not think the issue is to do with the code or configuration. From your mail and the earlier ones, I gather that this is an extremely rare happenning. Just how rare is my worry; often enough to justify external pullups?

Anand

Melanie
- 10th September 2006, 08:24
If this is anything other than a random happening then I'm in deep sh*t, because my top ten best selling designs all use weak pull-up's. Never, ever had a single return that has a fault on a pull-up input - and that's after years of sales...

mister_e
- 10th September 2006, 18:48
mmm, i don't know but you really have a PIC with a faulty internal pull-up?
If you add a external pull-up it works?

Is there any chance somewhere in your code some pin change from input to output? in this case it could disable some internal pull-up but...

Maybe some electrostatic discharge burned it? but if so... i guess it should go deeper than only the internal weak pull-up no? Strange...

ardhuru
- 10th September 2006, 19:43
mmm, i don't know but you really have a PIC with a faulty internal pull-up?
If you add a external pull-up it works?

Is there any chance somewhere in your code some pin change from input to output? in this case it could disable some internal pull-up but...

Maybe some electrostatic discharge burned it? but if so... i guess it should go deeper than only the internal weak pull-up no? Strange...

Yes, I think that last part should be it. I have an ICSP arrangement, with +5 to the target being supplied exclusively from an external supply. At times, when I'm not working on the project, this supply is switched off. And the programmer (an Epic clone), still connected to the PC, keeps the Vcc (not an issue in this case) *and* Vpp high, unless the programmer s/w (WinPic800) is initialised (loaded). The Pic therefore is exposed to Vpp without getting Vcc.

I think this kind of abuse might have caused the damage.

And yes, I confirm that external pullups work.

malc-c
- 11th September 2006, 19:24
Do you have a 0.1uF capacitor across the supply lines as near to the PIC. I found that without this I would sometimes have strange issues with the way a PIC would behave. Maybe this has some bearing on the problem here ?