User Manual

Mode 4: Packetized Serial Mode
Packetized Serial uses TTL level multi-byte serial commands to set the motor speed and
direction. Packetized serial is a one-direction only interface. The transmit line from the host is
connected to S1. The host’s receive line is not connected to the SyRen 50. Because of this,
multiple SyRens can be connected to the same serial transmitter. If using a true RS-232 device
like a PC’s serial port, it is necessary to use a level converter to shift the –10V to 10V rs-232
levels to the 0v-5v TTL. Packetized serial uses an address byte to select the target device. The
baud rate is set to 9600 baud from the factory. To change the baud rate, see the list of serial
commands later in this section.
Packet Overview
The packet format for the SyRen 50 consists of an address byte, a command byte, a data byte and
a seven bit checksum. Address bytes have value greater than 128, and all subsequent bytes have
values 127 or lower. This allows multiple types of devices to share the same serial line.
An example packet and pseudo-code to generate it are shown in Figures 7.1 and 7.2
Packet
Address: 130
Command : 0
Data: 64
Checksum: 66
Void DriveForward(char address, char speed)
{
Putc(address);
Putc(0);
Putc(speed);
Putc((address + 0 + speed) & 0b01111111);
}
Figure 7.1: Example 50% forward Figure 7.2: Pseudocode to generate 7.1
Baud Rate Selection:
Packetized Serial operates with an 8N1 protocol – 8 data bytes, no parity bits and one stop bit.
The baud rate is automatically calculated by the first character sent. This character must be 170
(binary 10101010) and must be sent before any serial communications are done. It is not possible
to change the baud rate once the bauding character has been sent. The valid baud rates are 2400,
9600, 19200 and 38400 baud. Until the bauding character is sent, the driver will accept no
commands and the green status light will stay lit. Please note that the SyRen 50 may take up to a
second to start up after power is applied, depending on the power source being used. Sending the
bauding character during this time period may cause undesirable results. When using
Packetized Serial mode, please allow a two second delay between applying power and
sending the bauding character to the drivers.