8servo controller using single 74hc595
December 5, 2008
I gave it a try tonight, since I always wandered whether it can be done. Control 8 servos over two wires, that's pretty attractive.
So the answer is yes, it can... and no it can not... Why?
- It worked. I managed to control 8 servos independently (they are indpendently postionable but can not be individually switched off - which would be nice in some circumstances (power saving))
- On Atmega 168 @ 16 Hz I achieved resolution of 125 steps per 1 ms and since I managed control the servo in the range of almost 0.5 - 2.5 ms I get ~ 250 steps per sth around 180 degrees
- It indeed uses only 2 wires to control 8 servos
- the interface is very simple - you just call a procedure to set a servo position
- the circuit is dead simple also - it uses a single 74HC595
- the handing of the add-on circuit on the microcontroller side is quite time-consuming. The interrupt routine gets called every 128 clocks, although mostly it only increases the counter, it sorta looks like the processor is busy some 50% of its time
- that asks for an implementation using a stand-alone microcontroller (sth like Attiny 2313) to leave the main unit free to do what's it supposed to do, but then you don't need the 595 at all - just one attiny would do, and you'd need a quarz resonator (20 or maybe 24 MHz overcocked) bunch of caps and at least 2 lines for data transmission and a protocol to controll the stuff.
So... I don't know... What do you think? Which way to go next?
top - just a single chip and pin headers
red +5v, blue 0v, yellow - clock, brown = data, black = reset hooked up to 5v
testbed: homebrew arduino used as dev.board programmed & debugged over ISP+debugwire using avrdragon
I also hooked it up to LEDs on my Attiny2313 proto board which helped a lot when debugging (while debuggin I slowed down the counter 64 times to see whether all shifts ok)