Maker Pro
Maker Pro

Making It High Impedance

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi all,
I have a shift register 74hc595. This is driving a uln2003lv transistor array, that in turn drive relay coils.
The shift register is controlled by a microcontroller. I need to make sure that the shift register is high z on switch on si I don't get relays coming on.
From the truth table the output enable line must be high and master clear a low.
The output enable is also used to switch the data onto the shift registers by making the line low.
Can I tie a pull up to the output enable line for switch on I.e. making it high?
But my question is how to make it low?
Do I need a transistor and base resistor (also resistor from base to 0v) to keep transistor off at switch on. then the collector to vCC via pull up. Then switch this line low by turning in the transistor.
Is that the best method?
Sorry if this seems trivial to some of you, I just need some clarification.
Thanks,
Raj
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You can connect the output enable input directly to your microcontroller output. A pull up of 10K or so will prevent it floating while the micro boots up. After that the micro is completely in control.

Bob
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Thanks Bob.
Please I need to ask another question. If I tie the output enable high via a 10k pull up to vcc. Do I need to configure the pin as a output?
After the initial micro power up sequence, this line then needs to be brought low so I can operate the shift register. Without using a transistor, will this line be pulled low via the internal transistor or get inside the micro I/o line? Might sound silly but I just need to be clear on it.
Best regards,
Raj
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Of course you have to make the pin on the micro an output!

The pin itself, with no external transistor will pull the input high or low with a reasonable valued pullup, like the 10K I suggested.

Bob
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Thanks. Then to bring it low, it's a simple case of outputting a 1 on the I/O line. The internal transistor (with its collector to Vcc via 10K) will pull the output to OV.
Does that sound reasonable?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Without using an external transistor, writing a 1 to the port will make the output go high.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
This is my confusion. The output enable line needs to be a high at switch on, hence the pull up. Now I thought that internally the i/O line has a transistor. The pull up is from the transistor collector to Vcc. Now for me to switch this line 0, don't I just output a 1, si the internal transistor is shorted to 0V?
Or do I need an external transistor?
Raj
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,681
Joined
Nov 17, 2011
Messages
13,681
Then to bring it low, it's a simple case of outputting a 1 on the I/O line.
To output a high voltage you write a logic '1' into the respective data bit of the µC's output register.
To output a low voltage you write a logic '0' into the respective data bit of the µC's output register.

Or do I need an external transistor?
No, you don't
This is a schematic representation of the µC's output transistors and the pull up resistor:
upload_2016-12-19_8-43-16.png

At start up (boot) the µC's pin is typically configured as input (to avoid interference with any external circuitry). Both transistors are off (see Bob's post #2). The pull up resistor ensures a logic high level (Vcc) on the output line.

During initialization of the µC you will configure the pin as output.
Writing a '1' into the output register will turn on M2, turn off M1. This ensures a high level (Vcc) on the output line.
Writing a '0' into the output register will turn on M1, turn off M2. This ensures a low level (0 V, ground) on the output line. In this mode a current will flow from Vcc through the pull up resistor into the output pin, through M1 to ground. As the 'resistance' of M1 when turned on is very much lower than the resistance of R1, the output voltage will be very near to ground (0V). think of M1, M2 as switches if that helps you undestand the principle.
 
Top