Author Topic: How to make a tristate output?  (Read 3026 times)

0 Members and 1 Guest are viewing this topic.

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
How to make a tristate output?
« on: May 18, 2015, 10:45:12 am »
Hi all,

For my application I need a shift register that could output either LOW or high impedance. All I came up with was a pile of transistors hooked up to a 74hc595 shift register:



I will use those outputs to switch in resistors setting levels in opamp amplifier gain and comparator threshold subcircuits:



Can anyone suggest me a more elegant solution to create low/high impedance outputs?

I know I could use digital potentiometers for the whole thing, but I really can't because of reasons that are out of my control.
« Last Edit: May 18, 2015, 10:49:22 am by miceuz »
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: How to make a tristate output?
« Reply #1 on: May 18, 2015, 11:18:55 am »
The normal way of doing things in the digital world is to wire a buffer chip between the shift register and the data bus. With Output Enable low any or all of the digital outputs can be high or low and with Output Enable high all outputs are high impedance.

Your requirement is different, you want to pull one or more resistors to ground depending on the shift register outputs. This isn't really 'Tristate' as there are only two conditions (grounded and high impedance). The best way of doing this I can think of is to use some of the CMOS switches that are around, a 74HC4066 contains four single-pole switches so in your case you would ground one end and connect the other to the resistor bank using the control pin to switch it on and off.

NOTE: All of these analog switches have a defined 'ON' resistance. For a 5V supply the 74HC4066 has an on resistance of about 50 ohms and this needs to be factored into your resistor values.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12645
  • Country: nz
Re: How to make a tristate output?
« Reply #2 on: May 18, 2015, 11:48:20 am »
Would i be yelled at for suggesting a 50c mcu programmed to act like a shiftreg?
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 952
  • Country: se
Re: How to make a tristate output?
« Reply #3 on: May 18, 2015, 11:51:20 am »
Basically you want a shift register with open collector or open drain outputs. The TPIC6C595 etc family of chips springs to mind.
 

Offline daqq

  • Super Contributor
  • ***
  • Posts: 2342
  • Country: sk
    • My site
Re: How to make a tristate output?
« Reply #4 on: May 18, 2015, 12:38:26 pm »
Can't you use a DAC directly? There are some very nice ones that allow you to do pretty much anything as they have both sides of the resistor network/string available on the pins.
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 

Offline miceuzTopic starter

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: How to make a tristate output?
« Reply #5 on: May 18, 2015, 02:36:05 pm »
Basically you want a shift register with open collector or open drain outputs. The TPIC6C595 etc family of chips springs to mind.

YESSS!! Thanks, this is exactly what I want, had it "on the tip of my tongue" whole time... silly me!  :palm: 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->