# One pin dual outputs

I have an inexpensive R/C car w/ the TX2/RX2 chipset. Typically, one would use a single pin per function on the RX2. Using that logic on an 8 pin PIC would leave me with 2 pins, one input and one output. After reading about the Ladybug Clone, I wondered if could get away w/ splitting the output of a single pin, one inverting and one non-inverting using a NOT gate and tri-stating the pin when I didn't want either output high.

## Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Inputs in your schematic the first input (the one above the other, output 1 from now on) will be low and the other output (output 2 from now on) will be high when the input is tri-stated. Here's why: Output 1 will be pulled down by 10K resistor at lower right. That same resistor with the leftmost resistor will also pull down the base of 2N2222 so your transistor is off. Because your transistor is off there's a voltage divider formed by 1K resistor and "the middle" 10K resistor determining output 2's value. Because of the voltage divider output 2's value will be high when input is tri-stated.

When I played around with tri-stating outputs I came to conclusion that I'll need 2 transistors (PNP and NPN) to make 3 different output combinations from 3 different values of one input (high, low and hi-Z). Notice that I also had 3 outputs to L293D: one to input 1, next to input 2 and last one to enable 1 (in http://letsmakerobots.com/node/17370). Enable pin was an easy solution to make one motor stop when input to the circuit was low.

Your explanation is the best reason I can give that I stick to coding rather than electronic construction. :) I understand exactly what you are saying, but, I can't be sure that I could have ever figured out why it would have been happening on a breadboard on my own. I guess for the most part I will stick with 'borrowing' circuits from those more educated than myself.

Borrowing from other people is ok. You can even learn from other peoples designs if you take some time to study them. I was a complete beginner in electronics last December. Back then I wouldn't have understood anything I wrote here earlier today :-)

One big help for me to start learning electronics was LTSpice (http://www.linear.com/designtools/software/#Spice). With LTSpice I was able to run simulations of simple circuits and see what voltages and currents I get at different parts of my circuit. I Used LTSpice simulations a lot when I designing that "tri-state motor driver" circuit. Of course you have to take some time to learn how to use that software if you want to do anything useful with it.

Thanks for the heads up. I had already saved that page to my hard drive for reference.I am guessing that the transistors that are driven are there, in part, to help keep the signal strong enough, current/voltage.

There are definitely some posts on tri-stating outputs and getting more functionality out fewer pins. Here's one succesful test by nuumio.

http://letsmakerobots.com/node/17370