You can use the serial interface for four general purposes: querying the TReX Jr for information (any mode), setting its configuration parameters (serial mode only), sending it motor commands (any mode), and upgrading its firmware (must be in firmware-upgrade mode). Firmware upgrading is addressed in Section 6.
Serial motor commands are accepted in any mode, but they will only immediately affect the motors if the TReX Jr is in serial mode or channel 5 has serial override active. When the TReX Jr is in RC or analog mode and serial override is not active, the most recently received serial motor command for each motor is buffered. These buffered motor commands take effect if serial override becomes active.
Note that when you are using the serial interface, . Because of the way the RS-232 circuit is tied to the logic-level serial lines, the TReX Jr can sometimes get its transmissions echoed back to itself. It deals with this by ignoring its receive line while it is transmitting, so anything you send it during this time will be lost. As a consequence, the TReX Jr will never transmit anything over the serial line without your first explicitly asking it to. The high-level protocol for sending commands that cause the TReX Jr to transmit data back to you should be as follows:
Motor commands are strictly one-way; the TReX Jr will not send data back in response to these. All other commands result in two-way data transfer.
An additional consequence of the RS-232 circuit is as you’re transmitting it (RS-232 transmit and receive lines are physically tied together by a resistor). If you are connecting your TReX Jr to a COM port, you can either disable your receiver while you transmit or you can simply discard the echoed bytes you know to expect. The command packet echo will always arrive before any data the TReX Jr sends to you. Note that to communicate with the TReX Jr.
US toll free: 1-877-7-POLOLU ~