It Moves!

 

walker-servo_response-IMG_5870Finally I got the code fixed that talks to the servos. The first AX-12A is moving. The scope screen shows the serial communication on the servo bus. Now I am expanding the functions to be able to talk with the three servos of the test foot. At the moment two AX-12A and one MX-28.

This servo configuration might change in the future, a parcel with more servos is on it’s way.

Stripping Arduino from the Arduino

arduino-IMG_5798I had bought an Arduino for my Walker project, a Mega 2560 to have enough pins, memory and compute power. A nice piece of hardware, and easy to use with plenty of software, as I had heard.

I am not unexperienced with AVRs. Owning a bunch of SPI programmers and a JTAGICE3.

The first thing I realized was that the easy to use development environment only supports one source file. Well. And it’s rather minimalistic. I switched to real makefiles and Eclipse.

Then I found out that the standard libraries are mainly supporting a linear synchronous programming model without fancy timers and interrupt handlers. I did start to write my own libraries in plain C.

When I tried to plug an interrupt routine into USART1 I got errors because the default libraries did occupy all serial interrupts, not only the one of USART0 used for the USB connection. That’s understandable because the AVR isn’t made for hardware abstraction and dynamic configuration. I did remove all the Arduino C++ code and recycled an existing library for the console I/O.

Now I am happy with an Arduino using purely the hardware. A really nice piece. I bought a second one.