User`s manual

ROBOT . HEAD to TOE
Product User’s Manual – SD02B
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved
36
Set UART Baudrate
a. The default baudrate for SD02B is 9600. However user can define new baudrate for
UART communication after the host and SD02B is connected at 9600. Host needs to
send ‘U’ to set new baudrate for communication with SD02B.
b. The standard baudrates for SD02B are 9600bps, 19200bps, 38400bps and 57600bps.
After sent the first command, host has to send the 8 bit value to SD02B according to
the explanation below. The values are the multipliers for 9600.
1 x 9600bps = 9600bps
2 x 9600bps = 19200bps
4 x 9600bps = 38400bps
6 x 9600bps = 57600bps
c. However, it is possible for user to operate SD02B at a baudrate other than the
standard baudrates given, but the success of the attempt is not guaranteed. For
example, you can try to send ‘3’ to SD02B to get the baudrate of 9600 x 3 =
28800bps.
Request current status
a. Host sends ‘C’ to request current status for On/Off, Go/Brake, CW/CCW, micro-
stepping and acceleration.
b. Host will receive 1 byte current status. From the 8 bit (1byte) received, only the lower
6 bits is used to indicate the current status. The status bits and its definition are shown
below.
7 6 5 4 3 2 1 0
1 0 0 0 0 0 1 1
send command 'C' to request current status
7 6 5 4 3 2 1 0
0 0 1 1 1 0 1 0
receive 1 byte, but current status is lower 6 bits
Send this 8 bit value to SD02B to
set the new desired baudrate.
0 = Off
1 = On
0 = deacceleration
1 = acceleration
0 = Accelerate deactivated
1 = Accelerate activated
0 = micro-stepping activated
1 = micro-stepping deactivated
0 = CW
1 = CCW
0 = Brake
1 = Go