SLAAEN4 March   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 UART
  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 UART Receive and Transmit (Transparent Transmission)
    6. 3.6 UART 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 CAN
    3. 5.3 CAN Bus Multi-Node Communication Example
  9. 6Summary
  10. 7References

UART Receive and Transmit (Transparent Transmission)

For UART Receive, there are three global variables defined in bridge_uart.c.

uint8_t gUartReceiveGroup[UART_RX_SIZE];
Custom_Element gUART_RX_Element;
uint16_t gGetUartRxMsg_Count;

The following is the process for UART Receive

  1. Call getUartRxMsg_transparent() to store message into gUartReceiveGroup. Message receiving is done when timeout occurs or when the group is full (data up to TRANSMIT_DATA_LENGTH bytes)
  2. Call processUartRxMsg_transparent() to extract data from gUartReceiveGroup and store the data into gUART_RX_Element.
  3. Put gUART_RX_Element into gUart2Can_FIFO.

For UART transmit, there are two global variables defined in bridge_uart.c.

uint8_t gUartTransmitGroup[UART_TX_SIZE];
Custom_Element gUART_TX_Element;

The following is the process for UART Transmit.

  1. Receive gUART_TX_Element from gCan2Uart_FIFO.
  2. Call processUartTxMsg_transparent() to get data from gUART_TX_Element and store it into gUartTransmitGroup.
  3. Call sendUartTxMsg() to transmit gUartTransmitGroup through UART.