Any bits that roll out of the checksum’s least significant
byte are ignored.
Let’s dry-run with an instruction that requires some
parameters. Let’s manually code up a READ_DATA digital
packet that will retrieve the AX- 12+’s ID from the Control
Table. The Control Table is simply a chunk of EEPROM and
RAM that holds the AX- 12+’s configuration and feedback
data. The first 23 Control Table entries are nonvolatile.
There are 49 Control Table memory slots:
//*******************************************************
//* CONTROL TABLE ADDRESSES
//*******************************************************
enum{
MODEL_NUMBER_L,
MODEL_NUMBER_H,
VERSION,
ID,
BAUD_RATE,
RETURN_DELAY_TIME,
CW_ANGLE_LIMIT_L,
CW_ANGLE_LIMIT_H,
CCW_ANGLE_LIMIT_L,
CCW_ANGLE_LIMIT_H,
RESERVED1,
LIMIT_TEMPERATURE,
DOWN_LIMIT_VOLTAGE,
UP_LIMIT_VOLTAGE,
MAX_TORQUE_L,
MAX_TORQUE_H,
STATUS_RETURN_LEVEL,
ALARM_LED,
// 0x00
// 0x01
// 0x02
// 0x03
// 0x04
// 0x05
// 0x06
// 0x07
// 0x08
// 0x09
// 0x0A
// 0x0B
// 0x0C
// 0x0D
// 0x0E
// 0x0F
// 0x10
// 0x11
Sources
• ROBOTIS — www.robotis.com
USB2Dynamixel; AX- 12+ Robot Actuator; Dynamixel
Manager
• Microchip — www.microchip.com
PIC18F2620; MPLAB IDE; MPLAB REAL ICE
• HI-TECH Software — www.htsoft.com
HI-TECH PICC- 18 C Compiler
The AX- 12+ firmware driver was compiled with HI-TECH
PICC- 18 PRO.
A Microchip MPLAB REAL ICE was used as the debugging
device.
36 SERVO 04.2009
SCREENSHOT 3. This is a capture of the PIC18F2620’s EUSART
receive buffer. A value of 0x00 in the ERROR byte is a very
good thing as bits that are set indicate errors.
ALARM_SHUTDOWN,
RESERVED2,
DOWN_CALIBRATION_L,
DOWN_CALIBRATION_H,
UP_CALIBRATION_L,
UP_CALIBRATION_H,
TORQUE_ENABLE,
LED,
CW_COMPLIANCE_MARGIN,
CCW_COMPLIANCE_MARGIN,
CW_COMPLIANCE_SLOPE,
CCW_COMPLIANCE_SLOPE,
GOAL_POSITION_L,
GOAL_POSITION_H,
MOVING_SPEED_L,
MOVING_SPEED_H,
TORQUE_LIMIT_L,
TORQUE_LIMIT_H,
PRESENT_POSITION_L,
PRESENT_POSITION_H,
PRESENT_SPEED_L,
PRESENT_SPEED_H,
PRESENT_LOAD_L,
PRESENT_LOAD_H,
PRESENT_VOLTAGE,
PRESENT_TEMPERATURE,
REGISTERED_INSTRUCTION,
RESERVE3,
MOVING,
LOCK,
PUNCH_L,
PUNCH_H
};
// 0x12
// 0x13
// 0x14
// 0x15
// 0x16
// 0x17
// 0x18
// 0x19
// 0x1A
// 0x1B
// 0x1C
// 0x1D
// 0x1E
// 0x1F
// 0x20
// 0x21
// 0x22
// 0x23
// 0x24
// 0x25
// 0x26
// 0x27
// 0x28
// 0x29
// 0x2A
// 0x2B
// 0x2C
// 0x2D
// 0x2E
// 0x2F
// 0x30
// 0x31
To access the AX- 12+ ID byte, we need to build a
READ_DATA digital packet to retrieve the fourth Control
Table byte. Since the READ_DATA instruction requires
parameters, the first step involves defining the parameter
table in the parms array:
parms[0] = ID; //starting read address
parms[1] = 0x01;//number of bytes to read from
// starting read address
Later on, we will write a function to load the parm
SCREENSHOT 4. The payload data (AX- 12+ ID) is loaded at
offset 6 in the EUSART’s receive buffer.