Let's Make Robots!

A thought for using the tristate capability of (some) picaxe pins

After reading Nuumio's tip, and reading some of the efforts by oddbot, nuumio and ignoblegnome, I was wondering if is possible to take advantage of the tristate config of the picaxe pins using only one transistor for each pin. I was really just trying to reduce the component count.. or more usefully, the SIZE of the board and it's cost.



I'm at work, so this is not somthing I can test right now, but while it's in my head, here is a thought that I drew up on the train. I've only drawn one pin here, which will control the direction and enable of half of a L293. V and G are supplied as labelled, etc.

The high/low/X (X= high impedance?) input from the picaxe is split in two, and one path is inverted. Eventually, the signal is rectified and combined and passed to M1 enable 

Along the way, the signals are piped out to the L239 via M1 inputs 1/0. 

I'd tried to arrange this so that while the pixaxe input is not X, then the enable will ALWAYS be high via one of the two diodes. However, if the picaxe is set to high impedance, then R3 will pull the signal down and un-enable pin - i.e. pull it to 0. 

The target truth table looks like; 

picaxe     M1-0  M1-1  EN 

 1            1       0       1

 0            0       1       1

 X           ?        ?       0


So, since I'd be the first to admit that I'm not 100% certain of what I'm doing, this is all just a bit of mental thrashing around. I'm likely to be simply advertising my poor grasp of digital electronics, but feel free to comment - but be nice!? 

Comment viewing options

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

I'll try my best to analyze your circuit and give some thoughts.

If my limited knowledge of electronics serves me right the transistor (lets say Q1) is off when picaxe is low or high impedance. Then R2 and R3 will create a voltage divider and M1-0 and M1 enable will have the same state (high/low state depending on R2 and R3 values).  When picaxe is high Q1 is on and so M1-0 is low. At the same time M1 enable is high (through D2).

Truth table of my analysis is as follows (say R2 = 1K, R3 = 10K):
Picaxe M1-0 M1-1 EN
1      0    1    1
0      1    0    1
X      1    0    1

I would be great to get this working with less components than what I'm using now. If it would only have happened a bit earlier... It was a bit messy thing to solder all those to 08 proto board :-) So more comments and thoughts are welcome.

Possibly OT, but tristating is used for charlieplexing (wikipedia), which is a way of addressing more LED's (or reading switches) using less pins.  If you aren't already familiar, you might find it interesting.