www.servomagazine.com/index.php?/magazine/article/june2013_MrRoboto
Figure 3
didn’t use a 74HC04 inverter. I just
used another one of my N-channel
FETs to handle the circuit that
switches between transmit and
receive.
The 5V regulator part of the
circuit is there should you want to
use an UNO32, which won’t have a
5V power option on a port. The
MX3cK, however, does have the
option of selecting 5V or 3.3V to
power an attached circuit board. So, I
used 5V from another port connector
to give me the 5V I needed for the
DATA line pull-up to the AX12a servo.
Because I could — and I think
that LEDs are useful — and I had an
extra I/O pin on the PMOD
connector, I put an LED there to be
blinked for any reason I wanted.
In electrical engineering, there is
a concept with logic circuits called
fanout. This is basically how many
gates a single gate can drive, or
talk to. I have not done careful
experimenting or datasheet analysis
of how many AX12as my circuit can
talk to before the driver on my board
is over-stressed and the servos don’t
get good data. I know that at least
three are fine. I’ll be doing more
work with this and will report my
findings.
Part 2: The Software
Listing 1: Setup function.
void setup() {
uint8_t n;
pinMode(nTxU2, OUTPUT);
pinMode(DLED, OUTPUT);
//~Tx/Rx: low transmit, high receive
// Das Blinken Lights, or LED
Serial1.begin(1000000);
Serial.begin(115200);
// Talk to Dynamixel AX12a at 1Mbps
// Talk to computer at 115.2Kbps
LookBus(20);
// Look for servo, address 0-20
Serial.println("Ready to roll\n");
}
Now that the hardware is done
and working, we need software that
will drive this bus at 1 Mbps. This is a
LOT faster than most serial
connections. Each bit will take 1 µs to
transmit, and each byte then takes
10 µs (eight bits of data; one stop
and one start bit.) This means that
you can send a lot of commands very
quickly.
This is essential if you are going
to control a robot with 16 or more
degrees of freedom. Timing becomes
more critical, however, so we need to
be careful about when we are
transmitting and when we expect to
12 SERVO 06.2013