English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i am doing a circuit using 8951...all my other ports are working fine except port 2, i am getting low outputs where we are supposed to get high outputs,i have connected relays to port 2 and its not operating ....can someone help??

2007-04-09 19:49:59 · 2 answers · asked by SHANKAR R 1 in Consumer Electronics Other - Electronics

2 answers

yeah, you cant operate a relay directly from a port pin. you need a relay driver between the port pin and the relay. the reason is the pin cant source enough current to operate the relay. the pins are weakly driven high so they can be externally driven low.

excerp from data sheet:

AT89C51RB2/RC2 I/O ports (P1, P2, P3) implement the quasi-bidirectional output that
is common on the 80C51 and most of its derivatives. This output type can be used as
both an input and output without the need to reconfigure the port. This is possible
because when the port outputs a logic high, it is weakly driven, allowing an external
device to pull the pin low. When the pin is pulled low, it is driven strongly and able to sink
a fairly large current. These features are somewhat similar to an open drain output
except that there are three pull-up transistors in the quasi-bidirectional output that serve
different purposes. One of these pull-ups, called the "weak" pull-up, is turned on whenever
the port latch for the pin contains a logic 1. The weak pull-up sources a very small
current that will pull the pin high if it is left floating. A second pull-up, called the "medium"
pull-up, is turned on when the port latch for the pin contains a logic 1 and the pin itself is
also at a logic 1 level. This pull-up provides the primary source current for a quasi-bidirectional
pin that is outputting a 1. If a pin that has a logic 1 on it is pulled low by an
external device, the medium pull-up turns off, and only the weak pull-up remains on. In
order to pull the pin low under these conditions, the external device has to sink enough
current to overpower the medium pull-up and take the voltage on the port pin below its
input threshold.

2007-04-11 02:42:50 · answer #1 · answered by justme 7 · 0 0

How are you trying to drive the relay? Do you have darlington transistor at the output? The output pins on MPUs are not capable of driving relays directly.

Most of the times, your output will be pulled up by resisters, which then connects to the base of the transistor, collector pulled up, emitter connected to ground via relay.

Try looking up sample circuits for driving relays. My guess is, you have none of this, and the output is drained excessively causing it to appear stuck at LOW.

Kind of hard to explain without pointing you to a circuit diagram. Hopefully, this is understandable.

2007-04-10 02:57:45 · answer #2 · answered by tkquestion 7 · 0 0

fedest.com, questions and answers