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.

Controlling relays using 89c51

Status
Not open for further replies.

chandu13

New Member
Hi friends,

I am driving 5V relays using ULN2803 conncected to a microcontroller 89c51 controller. when switching on the power all the realys are getting switched on and off with in a fraction of secons, since 89c51 initializes all the ports as output ports(i.e high). To avoid this i am trying to make all the port pins as 0's (low), though i am getting the same problem as before. Could anyone suggest me how to rectify this problem by using software logic, since my PCB has been already developed.

Waiting for your suggestion,

with regards,

Chandu,
 
Your request does not make sense.

When your 89C51 is under reset condition, all its port pins are high and this is causing you problem. The MCU is not even running any code yet.

How can a "software" change can help in this case?
 
8051's have quasi bi directional pins. Even though they are nominally high, any external load can pull them to ground since the pins can source only 60 microamps or so. I'd need to see a schematic to be sure, but I doubt there is a software fix. I see a board relayout in your future. So sorry!
 
So it's a high impedance pullup rather than a low impedance driver?
 
Sceadwian said:
So it's a high impedance pullup rather than a low impedance driver?
In the high state - yes. It can drive a gate input high but can be driven low by an external sink without causing the 8051 chip itself the slightest upset. Intel, and of course the 8051 clones, were the only folks cheap enough to take this dodge in 1978 rather than implement a true data direction register like the 6800 or 6502. Just look what happened to those visionary innovators -- go figure.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top