第 24 页 共 60 页
If the data length of CAN frame is 0, when the frame type or frame ID needs to be converted, the
corresponding conversion will be made, but the data field is empty. If there is no need to convert the frame
type or frame ID, no conversion will be done.
Conversion instance:
Example 1: Assume that the user configuration is as follows: frame information conversion is enabled and
frame ID conversion is enabled. If the CAN frame received by the CAN interface is an extended frame with
the frame ID of 0x00000001 and the data of 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 and 0x77, the CAN frame and
the converted UART frame are shown in Figure 3.16.
Figure 3.16 Example of converting CAN frame to UART
frame (transparent conversion, frame information and frame
ID conversion enabled)
3. CAN to SPI frame conversion(CAN
→
SPI)
TD5(3)USPCAN, as an SPI slave, can’t actively control SPI peripherals. When the product receives a frame
of data from the CAN bus, it can only be stored in the CAN receiving buffer immediately. When the number
of CAN frames in the CAN buffer reaches the feedback trigger frame number or trigger time, the INT pin
outputs a low level to inform the SPI host to read data.
After the SPI master obtains the size of the CAN buffer from TD5(3)USPCAN, SPI can read out all the CAN
frame data contained in the CAN buffer by one frame, as shown in Figure 3.17.