7
Zikodrive Motor Controllers is a trading name of Round Bank Engineering Ltd
Unit 4B, Top Land Business Park, Hebden Bridge, West Yorkshire, HX7 5RW
–
www.Zikodrive.com
- +44 (0) 1422
647177
The Zikodrive Protocol
All commands are initiated with a two-byte header, one-byte address code, one-byte register
address, 5 data bytes and then followed with a single Checksum byte. To ensure the correct data
is being transferred, the protocol will send either a confirm (0x06) or a reject (0x15) for a good,
or a bad command. If the ZD SERIES UART has accepted the command, the confirmation will then
be sent to the Master Controller and then process the given command. If the command was
rejected, all data will be disregarded with a NACK (0x15) and error code, and a new command
must be sent.
Example 1
–
Basic Command
From Master
0x7A 0x64 0x01 0x02 0x00 0x00 0x00 0x0E 0x10 0xDE
0x7A
=
Header, ASCII code “Z”
0x64
=
Header, ASCII code
“
D
”
0x01
=
Zikodrive Address, Set as 0x01 as default
0x02
=
Register, states which command/action you wish to change
0x00
=
Data byte 0
0x00
=
Data byte 1
0x00
=
Data byte 2
0x0E
=
Data byte 3
0x10
=
Data byte 4
0xDE
=
Checksum
CheckSum formula
Each command sent to the Zikodrive controller must be followed with a CheckSum byte or the
data will be rejected.
CHECKSUM = ((A RE DATA0 + DATA1 + DATA2 + DATA3 + DATA4) XOR 0xFF) & 0xFF;
The Address, the required register and the data bytes are all added together.
Command is run through an XOR with 0xFF
Command is then run through & with 0xFF