All port pins in microcontroller switches on and off when power on.

Thread Starter

KumaraGuruparan

Joined Aug 20, 2007
19
Hi

when i switch my microcontroller board all pins go high for a fraction of time and then goes low. All relays connected to the pins gets on at the same time. How to avoid it.
 

hgmjr

Joined Jan 28, 2005
9,029
You might benefit from putting pull-down resistors on those 8051 IO lines that are giving you problems.

On power-up, all of the digital IO lines come up in tristate mode so a pull-down will make sure that IO lines don't float to an undesired state.

hgmjr
 

Papabravo

Joined Feb 24, 2006
13,512
I'm sorry but this is really bad advice for an 8051. The quasi bidirectional output of an 8051 cannot source enough current to drive even a weak pulldown like 10K. The only solution on an 8051 is to make the relay activation signal active low with an inverter stage.

There was no indication that the OP was talking about an 8051 so maybe you have more information from another thread. Still I stand by my comment on using 8051 pins to drive active high circuits.
 

hgmjr

Joined Jan 28, 2005
9,029
You might benefit from putting pull-down resistors on those 8051 IO lines that are giving you problems.

On power-up, all of the digital IO lines come up in tristate mode so a pull-down will make sure that IO lines don't float to an undesired state.

hgmjr
Greetings KumaraGuruparan,

Ooopssss!!!!

papabravo has a valid point.

I did a little further checking and if your microcontroller happens to be an 8051 you will need to take the measures he has outlined.

The weak pull-up in the 8051 is much weaker than I understood it to be.

hgmjr
 

Thread Starter

KumaraGuruparan

Joined Aug 20, 2007
19
. The only solution on an 8051 is to make the relay activation signal active low with an inverter stage.

.
I m using 8051 microcontroller. If i make the relay activation signal low what will happen when i switch off the the board.At that time all the port pins will go high.
 

Papabravo

Joined Feb 24, 2006
13,512
I m using 8051 microcontroller. If i make the relay activation signal low what will happen when i switch off the the board.At that time all the port pins will go high.
That really depends on the relationship between th micro controller power supply and the relay power supply. Also it depends on the type of relay and weather you are using normally open or normally closed contacts.

I don't think an 8051 port pin can sink current when it is off. If the port pin can't sink any current and there is a pullup to the V+ that powers the coil then you will have no problem when the power to processor goes off and the power to the coil remains.
 

GirishC

Joined Jan 23, 2009
58
Kumara, tray to put all outs at low with the very first instruction in your code.

Alberto
I feel, you need to appreciate the basics of it. 8051 ports goes to high state during power cycle. So you get momentary switching on relay or any devices. If its connected to valve or motor, you definitely get irritated or complains from your customer. This is applicable in case of NO or NC contact.

For this type of problem we had to shift to a microcontroller and we used PIC. You need to choose a micro whose pins do not go high during booting process. And that's the key to your problem.
 
Top