Hello all!
I have two questions, I hope you could help me with.
I am programming AX motor in C with Cortex 4F processor, and I have some problems.
(1) I am not sure whether problem is in UART. I placed it on oscilloscope and noticed that it gives 3.3V when not transmitting and drops voltage down when transmitting data. Is this inverted logic okay for UART communication? I am no expert, so this got me confused.
(2) I wrote a C code, following e-manual on Robotis, and I am not sure why the motor won't move. Can you see it, please and tell me if there is a problem?
Code:
int main () {
int i = 0;
uint8_t send_data [11];
uint8_t position_LP, position_HP,
speed_LP, speed_HP;
position_LP = 512 & 0x00FF;
position_HP = ((512 & 0xFF00) >> 8);
speed_LP = 300 & 0x00FF;
speed_HP = ((300 & 0xFF00) >> 8);
checksum = 255 - ((0x01 + 0x07 + 0x03 + 0x30 + position_LP + position_HP + speed_LP + speed_HP) %256);
send_data [0] = 0xFF; // START
send_data [1] = 0xFF; // START
send_data [2] = 0x01; // DEVICE ID
send_data [3] = 0x07; // NUMBER OF PARAM
send_data [4] = 0x03; // WRITE
send_data [5] = 0x30; // ADDRESS OF GOAL POSITION REGISTER
send_data [6] = position_LP; // 8bit LOW
send_data [7] = position_HP; // 8bit HIGH
send_data [8] = speed_LP; // 8bit LOW
send_data [9] = speed_HP; // 8 bit HIGH
send_data [10] = checksum;
while (i < 11) {
uartTX_byte (send_data [i]);
i++;
}
}
Do you see a mistake, or can you direct me to a way how to deal with this problem?
I have configured AX to ID = 1, baud = 1MHz via Trossen's DynaManager. Currently, it is not on 512 position. None of the given positions work.
Thanks!
Bookmarks