PDA

View Full Version : ports go high on power up Aaargh!



kitcat
- 6th August 2005, 12:47
hi there.
I have a 16f872 and a vellman K8048 programmer. When I switch the programmer from standby to run, all of the porta pins go high until the chip is up and running. If I just plug the power supply into the programmer this does not always happen. With strategically placed leds I have noticed that sometimes I can get all the ports to go high when power is applied. It actually happens if I am a bit abusive and simulate a dodgy power supply connection. The problem is that if this were to happen on my project I would destroy my uln2803s. It would be very bad! Can anyone suggest how to garuntee that no pins will go high on power up or is it just an anomoly with my programmer.

Melanie
- 6th August 2005, 15:29
The allocation of Digital I/O (eg on Ports usually allocated as Analog on Power-Up), TRIS and setting the I/O initial status must be the first things that your PIC does on wake up. You need ensure the minimum time is wasted from the PIC powering-up, to setting those I/O pins Low.

It could also be that you have a particularly long Start-Up (eg a lazy PSU holding the MCLR line low for too long, or a large value Capacitor on MCLR) or your POR timer value (if you have one) is too long. If you just can't get those pins Low in time, and it's a mission critical kind of operation, you may need to add additional logic between the PIC and the input pins of your Driver to inhibit output until the PIC has woken properly.

pwhitt
- 6th August 2005, 15:51
I agree with Melanie re the additional logic. I would place latches on all of your output ports and link their enables to two pins on the PIC - for instance, require the enable code be 01 to activate your output. This way the chances of random activation of your output are drastically minimised.

To save a pin, you could use a pulse train on a single pin to count up to a certain value - thus activating a pin on a counter that would activate the latches. You might also even rig up a 555 timer to do a similar thing athough the implementation might be a bit convaluted.