第 19 页 共 60 页
3.2.3 UART configuration mode
In this mode, TD5(3)USPCAN is in the waiting configuration state and cannot send or receive data to the
CAN terminal. This mode can only be configured through UART interface. Please refer to Section 4 for specific
configuration instructions.
3.2.4 SPI configuration mode
In this mode, TD5(3)USPCAN is in the waiting configuration state and cannot send or receive data to the
CAN terminal. This mode can only be configured through SPI interface. Please refer to Section 4 for specific
configuration instructions.
3.3 Data conversion mode
The data conversion mode of TD5 (3)USPCAN refers to the basic rules of data conversion between serial
bus and CAN bus. At the same time, the product can only work in one data conversion mode. If you need to
change the data conversion mode, you need to change the configuration. When the product is configured
with a conversion mode, it acts on SPI to CAN mode and UART to CAN mode at the same time. There are
three data conversion modes of TD5(3)USPCAN: transparent conversion, transparent conversion with
identification, and custom protocol conversion.
3.3.1 Transparent conversion
Transparent conversion means that as soon as any side bus receives data, it is immediately sent to the
other side bus without any processing. In the transparent conversion mode, TD5(3)USPCAN does not need
additional data processing, which greatly improves the speed of data conversion and the utilization rate of
buffer, because TD5(3)USPCAN is also converting and sending at the same time of receiving, and the buffer
that can be received is also vacant. In the transparent conversion mode, the detailed description of data
conversion is as follows.
1. Serial frame to CAN frame conversion ( UART/SPI
→
CAN )
All the data of the serial frame are sequentially filled into the data field of the CAN frame. When the
product detects that there is data on the serial bus, it immediately receives and converts it. Because the
maximum data length of CAN frame is 8 bytes, when the data length of serial frame is less than or equal to 8
bytes, the data is forwarded through a CAN frame. If the data length of the serial frame is longer than 8
characters, the product starts with the first character of the serial frame, takes 8 characters at a time and
forwards them out through a CAN frame until all the data are forwarded, at which time one serial frame
data is converted into multiple CAN frame data. Schematic diagrams of data conversion are shown in Figure