ROBOT . HEAD to TOE
Product User’s Manual –
SD02C
7.4 SD02C UART Protocol
If you are using the UART protocol to control SD02C, both computer and microcontroller are
actually sending serial command to SD02C. This section explains the protocol for
send/receive commands.
NO
COMMAND
DESCRIPTION
PROTOCOL
BYTE
SEND/
RECEIVE
DATA (8-BIT)
BINARY
DECIMAL
ASCII
1
F
Turn OFF the stepper motor.
Send: <’F’>
1
st
Byte
send
01000110
70
F
2
O
Turn ON the stepper motor.
Send: <’O’>
1
st
Byte
send
01001111
79
O
3
G
Run the stepper motor. Send:
<’G’>.
1
st
Byte
send
01000111
71
G
4
B
Brake the stepper motor.
Send: <’B’>.
1
st
Byte
send
01000010
66
B
5
>
Set stepper motor direction
to clockwise. Send: <’>’>.
1
st
Byte
send
00111110
62
>
6
<
Set stepper motor direction
to counter-clocwise. Send:
<’<’>.
1
st
Byte
send
00111100
60
<
7
E
Request encoder value,
which is the number of steps
upon reset (max = 65535).
Send: <’E’>..
Received: <Higher
8-bit>,<Lower 8-bit>
1
st
Byte
send
01000101
69
E
2
nd
Byte
receive
Higher 8 bits
3
rd
Byte
receive
Lower 8 bits
8
R
Reset encoder value. Send:
<’R’>.
1
st
Byte
send
01010010
82
R
9
T
Track encoder value and
brake the motor at the value
given. Send
: <’T’>,<Higher
8-bit>,<Lower 8-bit>
1
st
Byte
send
01010100
84
T
2
nd
Byte
send
Higher 8 bits
3
rd
Byte
send
Lower 8 bits
10
S
Set stepper motor’s speed.
Send: <’S’>,<speed>
1
st
Byte
send
01010011
83
S
2
nd
Byte
send
Speed (1 Byte: 1-255)
11
A
Accelerate the stepper motor
from an initial speed to a
final speed at an acceleration
rate. Send <’A’>, <Initial
Speed>, <Final Speed>,
<Acceleration Rate>
1
st
Byte
send
01000001
65
A
2
nd
Byte
send
Initial Speed (1 Byte: 1-255)
3
rd
Byte
send
Final Speed (1 Byte: 1-255)
4
th
Byte
send
Acceleration rate (1 Byte: 1-255)
Slowest = 1, fastest = 255
12
U
Set new baudrate for
communication with SD02C.
1
st
Byte
send
1010101
85
U
2
nd
Byte
send
1 Byte: 1 = 9600bps, 2 = 19200, 4 = 38400,
6 = 57600
13
C
Request current status for
ON/OFF, GO/BRAKE,
CW/CCW, microstep?,
Accelerating? And
Acceleration/Deacceleration
?
1
st
Byte
send
1000011
67
C
2
nd
Byte
Status byte (lower 6 bits)
14
M
Set new Micro-step for
SD02C. Back to DIP
SWITCH setting if RESET.
1
st
Byte
send
01001101
77
M
2
nd
Byte
send
1 Byte: 1 = no micro-step, 2 = ½
micro-step, 4 = ¼ micro-step, 8 = ⅛
micro-step
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved