Problems with the communication, due to physical RS232 interface limitations

Our goal to have 1mbps communication between the CM5 and the Roboard, this is necessary to get as much as possible free processor time between packets.
The PC communications link on both the CM5 and CM510 is based on RS232 standard (12V).
The AVR processor on these boards has serial UART ports at 5V standard (TTL/CMOS). To do the step-up voltage conversion, CM5 uses the HIN232 chip and CM510 uses the MAX202C chip. Unfortunately these chips can only drive 125kbps and not 1mbps as we need.
To analyze the RS232 communications we have used the Saleae Logic Analyzer, connected to the lines between the Atmega microcontroller and the RS232 Transceiver (HIN232). You can see the probes in the following picture.
Our Communication consists in a packet from CM5 to Roboard composed by
[0xFF] [0xFF] [Len] [ID1] [POSLsb] [POSMsb] [ID2] [POSLsb][POSMsb]…[IDn] [POSLsb] [POSMsb] [CRC]
In reply to this packet Roboard has to send another packet that is basicly a an emcapsulation of Servo Sync write packets inside a single packet, composed by
[0xFA] [0xFA] [PacketLenLsb] [PacketLenMsb] [Sync write Packet 1] [Sync write Packet 2] … [Sync write Packet N] [CRC]
and a Servo Sync write Packet Packet is composed by
[0xFF] [0xFF] [0xFE][Len][0x83][ServoStartAddress][NbytesToRight][ID1] [Data1] [Data2] […] [DataN] [ID2] [Data1] [Data2] […] [DataN]…[IDn] [Data1] [Data2] […] [DataN][CRC]

In this case we just have one servo broadcast packet to send, to set positions on servos.
Even though the chips are rated with 125Kbps limitation, we manage to get stable communication at 500Kbps but only in one direction : CM5 to PC. In the picture below you can see the sequence of bytes sent from the CM5 to the Roboard and perfectly captured.

In the picture below you can see that the sequence of bytes sent between the  PC and the CM5, data flowing both directions at 500kbps, one communication and reply goes well but the second is not received correctly.

Analyzing a the packet we can see the difference between the bytes that we want to send the CM5, and the bytes being actually sent on the wire.

If the CM5-Roboard speed becomes a bottleneck, we will replace the the CM5 and the CM510 IC components with a chip called TRSF3232E from Texas Instruments that has the exact same package and pinout but supports 1Mb/s speed, this change may also require changing the capacitors used as “voltage pumps” in accordance with TRSF3232E component datasheet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: