xWRL6432 MMWAVE-L-SDK  05.04.00.01
MCAN External Read Write

Introduction

This example demonstrates (tested on) the CAN message communication to external PC via PCAN-USB (from PEAK Systems : IPEH-004022) in with the following configuration.

  • CAN FD Message Format.
  • Message ID Type is Standard, Msg Id 0xC0.
  • MCAN is configured in Interrupt Mode.
  • MCAN Interrupt Line Number 0.
  • Arbitration Bit Rate 1Mbps.
  • Data Bit Rate 5Mbps.
  • Buffer mode is used for Tx and RX to store message in message RAM.

MCAN Instance is set as a Commander in Transmit Mode. Message is transmitted and received back from external PC via PCAN-USB. Once message is transmitted the example will wait for recieving the messages from external PC. Have to manually transmit ten messages from external PC for test to finish. When the received message id and the data matches with the transmitted one, then the example is completed.

Supported Combinations

Parameter Value
CPU + OS m4fss0-0 freertos
m4fss0-0 nortos
Toolchain ti-arm-clang
Boards xWRL6432-evm
Example folder examples/drivers/mcan/mcan_external_read_write

Using SDK with SysConfig

A GUI tool SysConfig is used to configure different modules and peripherals of the example. Using this tool, users can select and customize different modules and peripherals. The SysConfig tool will generate the code for initializing and configuring these modules. This configuration is saved to a file called example.syscfg for every example. To know more about how to use SDK with SysConfig, Visit this page

Using SDK with SysConfig

Steps to Run the Example

  • Hardware Conectivity, connect the PCAN-USB module to PC from USB and Serial Port to be connected as mentioned in the image below.

MCAN Hardware Connectivity with PCAN USB.
  • Software Setup, Download and Install the PCAN-View from https://www.peak-system.com/PCAN-View.242.0.html?&L=1
  • Click on CAN in the menu bar and connect to PCAN-Usb. Set Mode as ISO CAN FD, Clock frequency as 80Mhz, Nominal bit rate of 1000 kbit/sec and sampling point in Nominal Bit Rate as 85 percent (Prescaler 2) and Sampling Point in Data Bit Rate as 87.5 percent (SSP Offset 14 and Prescaler 2). Rest as default.
    Tool configuration
  • When data is recieved from MCAN instance, it will be visible as shown in the image below in PCAN-View.
    Data received as shown in PCAN-View.
  • After successful reception of data, the data have to be transmitted ten times from PCAN-View for test to end.
  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
  • Launch a CCS debug session and run the executable, see CCS Launch, Load and Run

See Also

MCAN

Sample Output

Shown below is a sample output when the application is run,

[MCAN] External read - write test, application started ...
After transmitting the messages, it will wait to recieve ten messages for test to pass ...
All tests have passed!!