Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

GoGo Kit Serial Protocol

Version 3.00.2001110201 BETA


Arnan Sipitakiat
November 2001
© 2001 Future of Learning Group, MIT Media Laboratory.

General Info:

• There are two header bytes of 0x54, 0xFE leading every command.
• Following the header bytes are command bytes. Most commands require only one command
byte. The table below tells you when the second byte is required.
• After sending each command, the GoGo board will respond by sending back an
acknowledgment header (0x55, 0xFF). Other bytes may follow as described in the Command
definition below.

Here’s the format of the command bytes

Byte One:

CMD2 CMD1 CMD0 PARM2 PARM1 PARM0 EXT1 EXT-0


CMD0-2 = Command bits.
PARM0-2 = Parameter bits
EXT0-1 = Extended bits

Byte Two: (only for some commands)


EXTB7 EXTB6 EXTB5 EXTB4 EXTB3 EXTB2 EXTB1 EXTB0

Command Definition
CMD Description
000 Wakeup.
Parm0,1,2 and ext0,1 bits are combined to form a device ID to wake up.
ID 0 is always the local board
ID 1-31 are remote stations
Reply: Reply-Header (0x55, 0xFF) + Acknowledgment byte (0xAA)
001 Read sensor
Parameter bits: indicate which sensor to read
Extended bits: should always be 0.
Reply: Reply-Header (0x55, 0xFF) + sensor value high byte + sensor value low byte
010 Motor control
Parameter bits: identifies the operation
- 000 = ON
- 001 = OFF
- 010 = Reverse Motor Direction
- 011 = This way
- 100 = That way
- 101 = Coast
- 110 – 111 = Unassigned
Extended bits: should always be 0.
Reply: Reply-Header (0x55, 0xFF) + Acknowledgment byte (0xAA)
011 Set motor power
Parameter bits: define the power level (0-7).
Extended bits: should always be 0.
Reply: Reply-Header (0x55, 0xFF) + Acknowledgment byte (0xAA)
100 Talk to Motor
Command Length: 2 bytes
Parameter bits: should always be 0
Extended bits: should always be 0
Second byte: indicates which motor(s) to talk to.
Reply: Reply-Header (0x55, 0xFF) + Acknowledgment byte (0xAA)
101 Switch to burst mode.
Burst Mode will stream sensor data to the host to provide rapid sensor readings.

Command Length: 2 Bytes


Parameter bits: should always be 0
Extended bits: should always be 0
Second Byte: indicate which sensor port(s) should be included in the burst cycle (see below).
Note: A second byte of 0 will stop the burst mode.

Example 1:
1010 0000, 0000 0010 will tell the GoGo board to stream sensor port2’s value in the
following format

0x0C + High byte* + Low byte (3 bytes cycle)


*Bit 5,6,7 of the High byte indicates which sensor value it is.

An example of one burst cycle could be

0000-1100, 0010-001, 0100-0100

Bits 5,6,7 of the high byte (underlined) is 001 indicating that this is sensor2’s value.
The actual sensor value is 01 0100 0100 = 324

Example 2:
1010 0000, 1001 0010 will tell the GoGo board to stream sensor port2, port5, port8’s
values in the burst cycle. Thus, one burst cycle will consist of 9 (3x3) bytes. An
example of a cycle could be:

000-1100, 0010-001, 0100-0100,


000-1100, 1000-000, 0000-0010,
000-1100, 1110-0010, 0000 1001

Bits 5,6,7 of the second, fifth, and eighth byte are 001, 100, and 111 indicating that
they are sensor value of port 2, 5, and 8.
Their sensor values are 01 0100 0100, 00 0000 0010, and 10 0000 1001 accordingly.

Reply: Reply-Header (0x55, 0xFF) + Acknowledgment byte (0xAA) + Burst Cycles …


110 SendData Send a command through the auxiliary port (usually the RF port)
Command Length: 4-5 bytes
Parameter bits: should always be 0
Extended bits: should always be 0
Second byte: indicates which motor(s) to talk to.
Examples:
Command Bytes to send Reply bytes
Ping 0x54 0xFE 0x00 0x55 0xFF 0xAA
Turn on motor A 0x54 0xFE 0x80 0x01 0x55 0xFF 0xAA
(Activate motor A)
0x54 0xFE 0x40 0x55 0xFF 0xAA
(Turn motor on)
Turn on motor C 0x54 0xFE 0x80 0x04 0x55 0xFF 0xAA
(Activate motor C)
0x54 0xFE 0x40 0x55 0xFF 0xAA
(Turn motor on)
Turn on motor A and C 0x54 0xFE 0x80 0x05 0x55 0xFF 0xAA
(Activate motor A,C)
0x54 0xFE 0x40 0x55 0xFF 0xAA
(Turn motor on)
Read sensor1 0x54 0xFE 0x20 0x55 0xFF 0x01 0x37
(Sensor value is 0x137)

You might also like