320-0287I Using The USB and Serial Interfaces
320-0287I Using The USB and Serial Interfaces
Serial Interfaces
TDSR Headquarters
810 Tight Bark Hollow Road
Petersburg, TN 37144 USA
www.tdsr-uwb.com
Tel: +1 256.617.3132
+1 256.990.4217
320-0287I
October 2020
2 Using the USB and Serial Interfaces
Copyright
TDSR LLC 2020. All rights reserved.
Trademarks
Any trademarks, trade names, service marks or service names owned or registered by any other company and used in this
manual are the property of its respective company.
Rights
Rights to use this documentation are set forth in the TDSR Products Terms and Conditions of Sale.
Introduction
Many, if not all, of the members of the P400 series of Ultra Wideband (UWB) platforms offer the
ability to communicate with the device through either USB or a 3.3V serial UART port. The P400
series currently includes the P400, P410, P412, and P440 UWB platforms and will be collectively
referred to in this guide as a P4xx. The protocols used to communicate with P4xx modules are fully
defined in the MRM, CAT, and P400 RangeNet API Specification documents.
This document describes those features unique to the use of the USB and serial UART interfaces. It
should be noted that the P412 and P440 also are able to communicate via a CAN interface.
Information on how to interface with CAN is provided in the document 320-0326 CAN Interface
Application Note.
J18 J18
Fig.1: USB connector locations for P400 (Top Left), P410 (Top Right), and P440 (Center)
Note that the P440 has two USB connections. J13 only provides power to the P440; it has no data
connections. Similarly, J5 provides USB data connections and does NOT provide power.
USB Protocol
When connected over USB, the Host recognizes the P4xx units as standard serial communications
ports. More precisely, the USB port is a Communications Device Class (CDC) Abstract Control
Model (ACM). The Host can communicate with the P4xx units using the Host operating system’s
standard serial port API functions. On Microsoft Windows machines, for example, the modules will
appear as a virtual COM port.
Commands sent to the P4xx modules via the USB interface are identical to the commands sent over
the Ethernet interface, except each command must have a prefix of 4 bytes. The first two bytes of the
prefix are a synchronization pattern (0xA5A5) and the next 2 bytes are the length of the command
packet (i.e., the length of the command packet itself, not counting the 4 prefix bytes).
The resulting RCM_GET_CONFIG_CONFIRM packet sent from the P4xx is shown in Table 2.
Fig.2: Serial UART connector locations for P400 (Top Left), P410 (Top Right), P440 (Bottom
Center)
The connector is a 3-pin header (in the case of the P400) or a 6 pin header (P410 and P440) with the
pin definitions shown in Table 3. On a P400, pin 1 is the pin closest to the Ethernet connector. On a
P410, pin 1 is farthest from the USB connector. On a P440, pin 1 is farthest from the Ethernet
connector. Note that the serial UART uses 3.3V TTL levels as opposed to typical RS-232 voltages.
Serial to USB cables compatible with the P410 and P440 are available from FTDI (part number TTL-
232R-3V3) or through Digi-Key (part number 768-1015-ND). These cables use connectors which are
not polarized. The user should insure that the cable connector is lined up such that pin 1 on the
connector (typically marked with a small triangle) is lined up with pin 1.
The operating baud rate is controlled by a register in the ATMEL processor. The API command
RCM_SET_SERIAL_BAUD_RATE_REQUEST will allow the user to access this register and
change the UART data rate. Valid settings are 9.6k, 19.2k, 38.4k, 57.6k, 115.2k (default), 230.4k,
460.8k, and 921.26k.
In general, TDSR does not recommend that users increase the data rate to a value greater than the
default. But operation at higher speeds is possible if the cable is “short enough.” TDSR does not
know what the highest operating rate might be for your system. It is the user’s responsibility to
confirm through experimentation that any increase in bit rate continues to provide reliable
communications in the intended operating environment and over the intended operating temperature.
However, one user has reported that for his system a baud rate of 230.4 kbps was stable.
Serial Protocol
The P4xx serial UART uses the following communications parameters: 115,200 baud, 8 data bits, no
parity, and 1 stop bit (115200, 8, N, 1). No flow control is used.
Like the USB interface, the serial UART interface requires all commands to have a 4 byte prefix.
However, unlike the USB interface, the serial interface also requires a 2 byte suffix. The first two
bytes of the prefix are a synchronization pattern (0xA5A5) and the next 2 bytes are the length of the
command packet (i.e., the length of the command packet itself, not counting the 4 prefix bytes or 2
suffix bytes). The suffix bytes are a 16-bit cyclic redundancy check (CRC) to ensure validity of the
packet data. The length bytes and CRC bytes must be sent in network (big-endian) byte order (all
multi-byte fields in the API are sent in network byte order).
The CRC used is the CCITT CRC-16. The CRC is computed over the command packet only; the
CRC does not include the 4 prefix bytes. CRC sample code is included at the end of this document.
For example, the sequence of bytes in the RCM_GET_CONFIG_REQUEST message sent over the
serial interface is shown in Table 4. All numbers are in hexadecimal format. For multi-byte fields,
the most significant byte is designated by the abbreviation MSB, and the least significant byte is LSB.