![MORNSUN TD3USPCAN Application Notes Download Page 34](http://html1.mh-extra.com/html/mornsun/td3uspcan/td3uspcan_application-notes_1834434034.webp)
第 34 页 共 60 页
Figure. 3.26 CAN frame to SPI frame (transparent conversion with identification)
Conversion instance:
Example 1: It is assumed that the frame type of the CAN frame converted from user configuration is
"Standard Frame", and the starting address of "Frame ID" in SPI frame is 1 and the length is 2. If the CAN frame
received by the CAN interface is a standard frame, the first frame ID is 0x0122 and the data is 0x11, 0x22, 0x33,
0x44 and 0x55; The nth frame ID is 0x0234 and the data are 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 and 0x77
;
. Then
the CAN frame and the converted SPI frame are shown in Figure 3.27.
Frame ID1 and frame ID0 in the CAN frame are sequentially converted to the 2nd and 3rd bytes of each
byte segment, and the data field of the CAN frame is sequentially converted to the unfilled part of the serial
frame without any modification.