How to save a bit on an 08 robot

Rickharris

Senior Member
One of the issues in using a picaxe 08/ L293 combination on a robot is that the motor control uses 4 outputs from the Picaxe 08 and so you only have a single input as a touch sensor, this does not allow for left - right sensing.

BUT if you pair up the reverse function onto a single bit (you don't generally need to steer when reversing) you can free that bit to allow left and right sensing.

The diagram below shows Bit 0 , 1 Forward left and Right and output 2 is reverse.
 

Attachments

profmason

Member
I like the idea and have tried lots of different schemes to save that bit! However almost all the bots built are differential drive. Unless I am wildly misunderstanding the schematic your scheme would have the differential drive bot turning right twice as fast as left (Due to both wheels counter rotating in one case and not the other. Also it would preclude reverse all together. Still it would be worth it if you needed that other sensor! (And at times you do!) Yup, I am wildly misunderstanding the schematic. Thanks Wilf for the heads up!

The solution I have used instead is to use a pair of 74HC238 3 to 8 decoders. This lets you use only two outputs to drive the robot in all four possible states. Tie two 08M outputs to one 238 and the same two outputs to the other 238. (You are using the 3 to 8 decoder as a 2 to 4 decoder. The reason for this is that the 238 has a non-inverting output. You could use a single 74HC138 and a pair of hex inverters.) You will have to cross the outputs of the decoders to the hbridges. Wire your motor drivers appropriately and you can make all four possible desired states. In the case of differential drive this is:
1010
0110
1001
0101
Now you have added about a $1 to your project. Now that the 14M is out, I just use it!

I find the 14M is the ideal intro robotics chip. The 08M is now primarily used for data loggers and communication projects.

have fun!
 
Last edited:

leftyretro

New Member
I like the idea and have tried lots of different schemes to save that bit! However almost all the bots built are differential drive. Unless I am wildly misunderstanding the schematic your scheme would have the differential drive bot turning right twice as fast as left (Due to both wheels counter rotating in one case and not the other. Also it would preclude reverse all together. Still it would be worth it if you needed that other sensor! (And at times you do!)

The solution I have used instead is to use a pair of 74HC238 3 to 8 decoders. This lets you use only two outputs to drive the robot in all four possible states. Tie two 08M outputs to one 238 and the same two outputs to the other 238. (You are using the 3 to 8 decoder as a 2 to 4 decoder. The reason for this is that the 238 has a non-inverting output. You could use a single 74HC138 and a pair of hex inverters.) You will have to cross the outputs of the decoders to the hbridges. Wire your motor drivers appropriately and you can make all four possible desired states. In the case of differential drive this is:
1010
0110
1001
0101
Now you have added about a $1 to your project. Now that the 14M is out, I just use it!

I find the 14M is the ideal intro robotics chip. The 08M is now primarily used for data loggers and communication projects.

have fun!
Your suggestion cries out for a schematic drawing ;)

Or as often repeated, a picture is worth a thousand words.

Lefty
 

profmason

Member
Ok, I didn't breadboard it out just now but if I remember correctly it looks like the attached.
By controlling the two outputs from the 08M you can control all directions:
00 1010 forward
01 0101 reverse
10 1001 turn right
11 0110 turn left

If you are really desperate for pins you can leave it there and mimic off by rapidly toggling it from forward to reverse. Or you can run a third output to the enable pin on 74hc238s.

This is all a moot point now that the 14M is out! In the US, the 08M and the 14M cost the same within pennies.

have fun!
 

Attachments

wilf_nv

Senior Member
Keep it simple

Rick Harris got it right the first time using 3 outputs connected directly to the L293 quad half bridge motor driver to control the following 7 motor output states:

0-stop
1-turn right forward
2-turn left forward
3-straight forward
4-straight reverse
5-turn left reverse
6-turn right reverse
7-stop

Many switches and other binary inputs can be sensed using the remaining two 08M I/O pins.
 
Top