Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Baud rate problem

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
6 postsPage 1 of 1
6 postsPage 1 of 1

Baud rate problem

Post by Starlight » Sat Feb 14, 2009 5:34 pm

Post by Starlight
Sat Feb 14, 2009 5:34 pm

Hi. Currently I'm successful get the response from the AX-12 using PIC18F4450 using default baud rate of 1Mbps. By the way, I'm accidentally changing the baud rate to 645161.29bps. the code as below:
uart_send(0xFF);
uart_send(0xFF);
uart_send(0x01); //ID

uart_send(0x09); //LENGTH
uart_send(0x03); //INSTRUCTION = WRITE_DATA
uart_send(0x03); //START ADDR (ID)
uart_send(0x02); //NEW ID
uart_send(0x1e);
uart_send(0x01);
uart_send(0x01);
uart_send(0x01);
uart_send(0x01);
uart_send(0xcb);

Now my PIC can't set the baud rate as close to the baud rate of AX-12(0x1e). So is there any solution to reset the baud rate of AX-12 to the factory's default baud rate (1Mbps) ?Thanks.
Hi. Currently I'm successful get the response from the AX-12 using PIC18F4450 using default baud rate of 1Mbps. By the way, I'm accidentally changing the baud rate to 645161.29bps. the code as below:
uart_send(0xFF);
uart_send(0xFF);
uart_send(0x01); //ID

uart_send(0x09); //LENGTH
uart_send(0x03); //INSTRUCTION = WRITE_DATA
uart_send(0x03); //START ADDR (ID)
uart_send(0x02); //NEW ID
uart_send(0x1e);
uart_send(0x01);
uart_send(0x01);
uart_send(0x01);
uart_send(0x01);
uart_send(0xcb);

Now my PIC can't set the baud rate as close to the baud rate of AX-12(0x1e). So is there any solution to reset the baud rate of AX-12 to the factory's default baud rate (1Mbps) ?Thanks.
Starlight
Robot Builder
Robot Builder
Posts: 21
Joined: Wed Oct 08, 2008 2:52 am

Post by RandomMatt » Sat Feb 14, 2009 7:28 pm

Post by RandomMatt
Sat Feb 14, 2009 7:28 pm

You need to use the bootloader to reset the eeprom. (This will make your servo have ID=1).

1) enter the bootloader. You need to send many '#' characters to the servo (at 57600 baud) as it turns on (within ~60ms). The bootloader should respond with a '*'. The led should remain on.

2) reset the eeprom. send a 'c', wait for a '*'.

3) enter application mode. send an 'a', wait for a '*'. Followed by a 'g'.

--

You may also want to 'lock' the servo to stop this kind of mistake... just write a 0x01 to location 47. You'll still be able to control the torque, led, speed, position but you will not be able to mess up the id, baud rate, automatic turnoff etc.
You need to use the bootloader to reset the eeprom. (This will make your servo have ID=1).

1) enter the bootloader. You need to send many '#' characters to the servo (at 57600 baud) as it turns on (within ~60ms). The bootloader should respond with a '*'. The led should remain on.

2) reset the eeprom. send a 'c', wait for a '*'.

3) enter application mode. send an 'a', wait for a '*'. Followed by a 'g'.

--

You may also want to 'lock' the servo to stop this kind of mistake... just write a 0x01 to location 47. You'll still be able to control the torque, led, speed, position but you will not be able to mess up the id, baud rate, automatic turnoff etc.
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by i-Bot » Sat Feb 14, 2009 11:22 pm

Post by i-Bot
Sat Feb 14, 2009 11:22 pm

By the way, I'm accidentally changing the baud rate to 645161.29bps.

I think it is 64516.128bps not 645161.29bps if you entered 0x1E.

If you get within 10% on the PIC you should be OK, that should be possible to communicate without error.

Why are you setting the other locations beyond the ID and baud rate ?
By the way, I'm accidentally changing the baud rate to 645161.29bps.

I think it is 64516.128bps not 645161.29bps if you entered 0x1E.

If you get within 10% on the PIC you should be OK, that should be possible to communicate without error.

Why are you setting the other locations beyond the ID and baud rate ?
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Starlight » Sun Feb 15, 2009 1:44 am

Post by Starlight
Sun Feb 15, 2009 1:44 am

Why are you setting the other locations beyond the ID and baud rate ?


Actually this is my first time using the AX-12 actuator. In the beginning, I just want to change the default ID of 1 to ID 2 but I forgot after we send the start address code (0x03), the following address will be follow the item in control table in sequence including baud rate, return delay time, etc.

You may also want to 'lock' the servo to stop this kind of mistake... just write a 0x01 to location 47. You'll still be able to control the torque, led, speed, position but you will not be able to mess up the id, baud rate, automatic turnoff etc.

I should know this kind of solution early. Thanks RandomMatt.
Why are you setting the other locations beyond the ID and baud rate ?


Actually this is my first time using the AX-12 actuator. In the beginning, I just want to change the default ID of 1 to ID 2 but I forgot after we send the start address code (0x03), the following address will be follow the item in control table in sequence including baud rate, return delay time, etc.

You may also want to 'lock' the servo to stop this kind of mistake... just write a 0x01 to location 47. You'll still be able to control the torque, led, speed, position but you will not be able to mess up the id, baud rate, automatic turnoff etc.

I should know this kind of solution early. Thanks RandomMatt.
Starlight
Robot Builder
Robot Builder
Posts: 21
Joined: Wed Oct 08, 2008 2:52 am

Post by Starlight » Sun Feb 15, 2009 3:43 am

Post by Starlight
Sun Feb 15, 2009 3:43 am

i tried method below, but it ax-12's LED keep light on after i restart the ax-12.
and it seems i could not have any response at 1 M after i tried the method..

1) enter the bootloader. You need to send many '#' characters to the servo (at 57600 baud) as it turns on (within ~60ms). The bootloader should respond with a '*'. The led should remain on.

2) reset the eeprom. send a 'c', wait for a '*'.

3) enter application mode. send an 'a', wait for a '*'. Followed by a 'g'.


Is the LED of AX-12 should keep ON after i restart the AX 12?
i tried method below, but it ax-12's LED keep light on after i restart the ax-12.
and it seems i could not have any response at 1 M after i tried the method..

1) enter the bootloader. You need to send many '#' characters to the servo (at 57600 baud) as it turns on (within ~60ms). The bootloader should respond with a '*'. The led should remain on.

2) reset the eeprom. send a 'c', wait for a '*'.

3) enter application mode. send an 'a', wait for a '*'. Followed by a 'g'.


Is the LED of AX-12 should keep ON after i restart the AX 12?
Starlight
Robot Builder
Robot Builder
Posts: 21
Joined: Wed Oct 08, 2008 2:52 am

Post by RandomMatt » Sun Feb 15, 2009 11:23 am

Post by RandomMatt
Sun Feb 15, 2009 11:23 am

The led should remain on when step 1 is successful. It should go off again after you send the 'g' in step 3.

--

If you can, just attach a console of some sort(**) to the servo (at 57600) and you'll be able to see what is happening. (you may want to send an 'h' to get the help - and you really don't want to send an 'l').

(**) I did this by using the CM5 to effectively bridge the two UARTs (one is at TTL level, the other RS232). How many UARTs does your PIC have?
The led should remain on when step 1 is successful. It should go off again after you send the 'g' in step 3.

--

If you can, just attach a console of some sort(**) to the servo (at 57600) and you'll be able to see what is happening. (you may want to send an 'h' to get the help - and you really don't want to send an 'l').

(**) I did this by using the CM5 to effectively bridge the two UARTs (one is at TTL level, the other RS232). How many UARTs does your PIC have?
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm


6 postsPage 1 of 1
6 postsPage 1 of 1