SLAAEN5 February 2025 MSPM0G1106 , MSPM0G1107 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3518-Q1 , MSPM0G3519 , MSPM0G3519-Q1
The CAN-SPI bridge connects the CAN and SPI interfaces. The bridge supports the SPI to function in either slave mode or master mode. The example in this document uses the CAN analyzer to observe the CAN data. Users can also send messages from the CAN analyzer over the CAN-SPI bridge to the SPI side. For SPI data, users can use a logic analyzer or use two LaunchPADs to form a loop to observe, such as the accompanying demo in Figure 4-1.
The example in this article support both transparent transmission and protocol transmission. Figure 1-1 shows the logic analyzer observation for transparent transmission. Figure 1-2 shows the logic analyzer observation for protocol transmission.
For protocol transmission, this example specifies the SPI message format. Users can modify the format according to application requirements. When receiving the message from the SPI, the message format is < 55 AA ID1 ID2 ID3 ID4 Length Data1 Data2 ...> Users can send data through SPI with the same format. 55 AA is the header. The ID area is four bytes. The length area is one byte, which indicates the data length.
For transparent transmission, a configurable timeout is used for the SPI slave to detect one message. Data from the SPI is filled into the data area of the CAN (same in reverse). The CAN ID is the default value.
Figure 1-1 Logic Analyzer for SPI
Transparent Transmission
Figure 1-2 Logic Analyzer for SPI
Protocol Transmission