I'm having problems initializing the 8051. It's P1 ports are driving 4 relays using a ULN2003 driver, the problem is, when I power on the ckt, all relays are switched on and off. I've tried to use a 7414 to invert all P1 ports, but did not work. How to solve it?
hi,i think you make some mistakes.i did a job like this ,it works well.
i think:
1:do not use any pull up resistor;
2:your relay should be connect in collector of uln2003;
3:use a pull up resistor in P1;
4:if all above can not work,use a enable pin to enouble the uln2003,such as a 74hc244 or 74hc245 driver,use another io to control the 74hc245 enable pin ,do not forget a pull up resistor.
this can slove your problem.
Sometimes, you can try ATMEL and Philips one...
DO NOT use winbond one.. We met a lot of problem with winbond.
Its port is easily broken and output glitch while power on.
Most Micros ports go high (read) at power up before your embedded s/w takes over. The best way is to use an invertor on the inputs to the ULNxxx and use active low o/ps. Another way is to use another spare port pin and switch a PNP transistor/relay? that applies common power to all the other relays when the circuit has stabilised. Yet another ways is to use an RC timed relay on the PSU to do the same thing. Hope this gives you some ideas.
Some times ago I had a problem powering up a Temic 8051. If the power-up-rise-time was too slow (about some 10ms) the ports did NOT go to a high state, also not when reseted! But the processor and it's ports were running 8O . So check your power-up-time and compare it to the specs.
If you absolutely have to use active high ouputs, you could maybe use sil resistor packs and pull to ground, I would suggest 3k3-10k as a starting point. This should be enough to pull down the weak pullup resistors on most ports. This of course will make the circuit a little more power hungry, but should work on micros that can souce moe than a couple of ma. Should be OK on Pics, but maybe a problem on such as 8051s with low drive capability.
Anyway it is not really good design practice, much better to use hex invertors etc. Dont know why it is so difficult to find darlington drivers with invertors built in, bit like trying to find common anode leds :lol
This may sound silly but what about a simple RC circuit on the enbale pin of a driver. Connect P1 to the driver 74hc245 (or such) and drive the relays from here. When the system is powered on the RC circuit will keep the driver disabled after the system is initialized then enable the driver. For a reset after the power has been on a while just reset the RC circuit at the same time.