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

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Bridge between CAN and SPI
  5. 2Implementation
    1. 2.1 Principle
    2. 2.2 Structure
  6. 3Software Description
    1. 3.1 Software Functionality
    2. 3.2 Configurable Parameters
    3. 3.3 Structure of Custom Element
    4. 3.4 Structure of FIFO
    5. 3.5 SPI Receive and Transmit (Transparent Transmission)
    6. 3.6 SPI Receive and Transmit (Protocol Transmission)
    7. 3.7 CAN Receive and Transmit
    8. 3.8 Application Integration
  7. 4Hardware
  8. 5Application Aspects
    1. 5.1 Flexible structure
    2. 5.2 Optional Configuration for SPI
    3. 5.3 Optional Configuration for CAN
    4. 5.4 CAN Bus Multinode Communication Example
  9. 6Summary
  10. 7References

Hardware

By using a CAN analyzer, users can send and receive messages on the CAN side. As a demonstration, two LaunchPad™s can be used as two CAN-SPI bridges(one SPI master and one SPI slave) to form a loop. When the CAN analyzer sends CAN messages through the master LaunchPad, the analyzer receives CAN messages from the slave LaunchPad. Figure 4-1 shows the basic structure. Note that CAN transceivers are required to construct a CAN bus. Figure 4-2 shows the messages sent and received by CAN analyzer for the demo.

The accompanying demo uses two launchpads, a TCAN1046EVM and a CAN analyzer. TCAN1046EVM is a high-speed dual channel CAN transceiver evaluation module. Figure 4-3 shows the connection of the demo. A PA12 LaunchPad is used for the CAN transmit and a PA13 LaunchPad is used for the CAN receive. PA12 and PA13 must be connected to the TX pin and the RX pin of TCAN1046EVM. PB9 is used for SPI SCLK (clock). PB8 is used for SPI MOSI (master out, slave in). PB7 is used for SPI MISO(master in, slave out). PB6 is used for SPI CS (chip select). PB20 is used for IO trigger from I2C slave to master.

For TCAN1046EVM, (since TCAN1046 supports level shifting), VCC must be connected to 5V and VIO must be connected to 3.3V. The termination on the CAN bus (CANH and CANL) must be configured with the J2 (or J3) and J6 (or J8) jumpers. Each jumper adds 120Ω termination to the respective bus. For more information, see related documentation.

 Basic Structure of
                    Accompanying Demo Figure 4-1 Basic Structure of Accompanying Demo
 Messages Sent and Received by
                    CAN Analyzer for the Demo Figure 4-2 Messages Sent and Received by CAN Analyzer for the Demo
 Hardware Connection of the
                    Demo Figure 4-3 Hardware Connection of the Demo