Arduino XBee Serial Multiple Servo Solution
August 19, 2010
Here i present my Arduino XBee Serial Multiple Servo Solution
Here is a Sketch of the system (apparently sketching your ideas is the thing todo...........)
I thought i was home and dry with my Depron1, Depron2 project untill i found out that mixing serial data and servos (ie >2 servos) with the Arduino environment is just not possible (due to the complexity of the multiple interrupts).
Here is my solution so far :-
Take 2 Atmega 328 chips with the Arduino Bootloader.
We call them AtmegaSerial and AtmegaPWM
Connect the data pins (d0-d7) of both AtmegaSerial & AtmegaPWM together - this will be your 8bit parallel data bus.
Connect the data pins (b8-b10) of both AtmegaSerial & AtmegaPWM together - this will be your 3bit parallel address bus.
Here is how it works :-
Serial data (servo positions) are TX_ed over an XBee link.
The RX Xbee ports the serial data to the AtmegaSerial chip, which then sorts and stores the servo positions into an string array.
The AtmegaPWM (servo driver) chip clocks its address bus (b8-b10) in the background.
The AtmegaSerial chip is watching this address bus and applys the corresponding data to the data bus (d0-d7)
The AtmegaPWM (servo driver) reads the data off the data bus and sends a PWM value to the servo(s), "Yo", we have contact.
Ok - Here at LMR you get to see the nuts and bolts.
Yes it works........... now i have to push it to see just how many Servos i can control with it.
I will not be testing more than 6 servos - unless a generous vendor would sponsor some more (haha).