How to control multiple Robotis Dynamixel AX-12 from a .NET Micro Framework environment.
The first step is to wire everything up, we use port 0 and 1 for serial RX and TX, and digital port 2 for controlling the half duplex communication. For this we need an 74LS241, take a look at the setup:
http://savageelectronics.blogspot.com/2011/01/arduino-y-dynamixel-ax-12.html
We need a 74LS241 connected this way:
- Pin 2 to Pin 3 (data out to AX-12)
- Pin 1 to Pin 19 (connected to Digital 2 on NETMF)
- Pin 18 (connected to RX on NETMF)
- Pin 17 (connected to TX on NETMF
- Pin 10 to ground
- Pin 20 to Vcc
The next step is controlling this from code, the TinyCLR wiki helps us a bit:
http://wiki.tinyclr.com/index.php?title=Dynamixel_AX12
Here is the code for initializing the serial port to 1.000.000 mbps:
SerialPort serial = new SerialPort("COM1", 1000000, Parity.None, 8, StopBits.One);
serial.ReadTimeout = 100;
serial.Open();
//fix the baud on COM1 to non-standard 1000000
Register U0FDR = new Register(0xE000C028);
U0FDR.Write((8 << 4) | 1);//fix the fractional divider register
AX12_PacketHandler AX12 = new AX12_PacketHandler(serial);
AX12.SetLimits(1, 205, 818);
AX12.move(1, 205);



