A thought for using the tristate capability of (some) picaxe pins
February 23, 2010
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!?