Readme

Example Summary

This example demonstrate how to send multiple CAN-FD messages with message IDs 0x3 and 0x4 via GPIO input interrupt.

The least-significant bit (LSB) in the fist data byte of the packet is toggled every time the messages are transmitted.

This example can be used with the mcan_multi_message_rx example project.

Peripherals & Pin Assignments

Peripheral Pin Function
GPIOB PB21 Standard Input with internal pull-up
SYSCTL PA5 HFXIN
SYSCTL PA6 HFXOUT
EVENT
CANFD0 PA13 RX Pin
CANFD0 PA12 TX Pin
DEBUGSS PA20 Debug Clock
DEBUGSS PA19 Debug Data In Out

BoosterPacks, Board Resources & Jumper Settings

Visit LP_MSPM0G3507 for LaunchPad information, including user guide and hardware files.

Pin Peripheral Function LaunchPad Pin LaunchPad Settings
PB21 GPIOB PB21 J27_4
  • PB21 is connected to S2 button to GND with no external pull resistor
    • Press S2 button to connect pin to GND
    • Don’t use S2 button if not needed by application
PA5 SYSCTL HFXIN J28_4
  • PA5 is used for HFXT functionality by default in Launchpad
    • Y2 crystal is soldered and connected by default

  • PA5 can be connected to J28_4
    • R15 is not soldered soldered by default
    • Solder R15 to connect pin to J28_4
PA6 SYSCTL HFXOUT J28_5
  • PA6 is used for HFXT functionality by default in Launchpad
    • Y2 crystal is soldered and connected by default

  • PA6 can be connected to J28_5
    • R17 is not soldered soldered by default
    • Solder R17 to connect pin to J28_5
PA13 CANFD0 CANRX J4_32/J26_3
  • PA13 can be connected to CAN/LIN connector in addition to boosterpack connector:
    • To use on J26 CAN/LIN connector:
      R65 is populated by default and connects pin to J26_3
PA12 CANFD0 CANTX J4_32/J26_1
  • PA12 can be connected to CAN/LIN connector in addition to boosterpack connector:
    • To use on J26 CAN/LIN connector:
      R64 is populated by default and connects pin to J26_1
PA20 DEBUGSS SWCLK N/A
  • PA20 is used by SWD during debugging
    • J101 15:16 ON Connect to XDS-110 SWCLK while debugging
    • J101 15:16 OFF Disconnect from XDS-110 SWCLK if using pin in application
PA19 DEBUGSS SWDIO N/A
  • PA19 is used by SWD during debugging
    • J101 13:14 ON Connect to XDS-110 SWDIO while debugging
    • J101 13:14 OFF Disconnect from XDS-110 SWDIO if using pin in application

Device Migration Recommendations

This project was developed for a superset device included in the LP_MSPM0G3507 LaunchPad. Please visit the CCS User’s Guide for information about migrating to other MSPM0 devices.

Low-Power Recommendations

TI recommends to terminate unused pins by setting the corresponding functions to GPIO and configure the pins to output low or input with internal pullup/pulldown resistor.

SysConfig allows developers to easily configure unused pins by selecting BoardConfigure Unused Pins.

For more information about jumper configuration to achieve low-power using the MSPM0 LaunchPad, please visit the LP-MSPM0G3507 User’s Guide.

Example Usage

Connect the CAN_RX and CAN_TX to TCAN1042DEVM pins as described in TCAN Evaluation Module User’s Guide and monitor and receive CAN-FD packages using mcan_multi_message_rx example project or using a CAN Bus Analyzer tool of your choice.

Ensure the MCAN receiver is running.

Compile, load and run the example.

The example has the following Nominal and Data Rate frequencies configured:

When S2 button is pressed (or the GPIO detects a falling input edge), the following CAN-FD packages with IDs 0x4 and 0x3 will be transmitted simultaneously. Each time the S2 button is pressed, the data (the LSB of the first data payload byte) that each message sends will be toggled.

Message 1:

Message 2:

When using this example with mcan_multi_message_rx example, the packages controls the state of two LEDs.

Note: There is a known limitation where the example might stop transmitting packages if the application halt execution after hitting a breakpoint. It is highly recommended to use the free run option while testing the example.