MCAN interrupt
This example application shows how to use the MCAN module to transmit and receive CAN messages in interrupt mode.
Description
This application transmits and receives CAN messages on the CAN bus. To run this application, an evaluation board and Microchip CAN Bus Analyzer is required . They act as different nodes on the CAN bus. While running the application, user can send and receive CAN messages between the board and the analyzer.
Downloading and building the application
To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.
Path of the application within the repository is apps/mcan/mcan_normal_operation_interrupt/firmware .
To build the application, refer to the following table and open the project using its IDE.
Project Name | Description |
---|---|
sam_a5d2_xult.X | MPLABX project for SAMA5D2 Xplained Ultra Evaluation Kit |
Setting up AT91Bootstrap loader
To load the application binary onto the target device, we need to use at91bootstrap loader. Refer to the at91bootstrap loader documentation for details on how to configure, build and run bootstrap loader project and use it to bootstrap the application binaries.
Setting up the hardware
The following table shows the target hardware for the application projects.
Project Name | Board |
---|---|
sam_a5d2_xult.X | SAMA5D2 Xplained Ultra Evaluation Kit |
Setting up SAMA5D2 Xplained Ultra Evaluation Kit
Addtional hardware required
- To run the demo, the following additional hardware are required:
Setting up the board
- Install Microchip CAN Bus Analyzer software on PC
- Connect Microchip CAN Bus Analyzer to ATA6563 click board using female to female DB9 serial cable
-
Connect ATA6563 click board to the SAM A5D2 XULT as per the Pin connections shown below
SAMA5D2 XULT ATA6563 click board CANTX0 (PIN8), J9 Connector RX (PIN 14) CANRX0 (PIN7), J9 Connector TX (PIN 13) 3V3 (PIN20), EXT1 Connector 3V3 (PIN 7) VDD_5V (PIN3), J24 Connector 5V (PIN 10) GND (PIN19), EXT1 Connector GND (PIN 9) - Connect Microchip CAN Bus Analyzer to PC using USB Male-A to Male Mini-B cable
- Short jumper JP2 (DEBUG_DIS)
- Connect the Debug USB port on the board to the computer using a micro USB cable
Running the Application
- Build the application using its IDE
- Open the Terminal application (Ex.:Tera term) on the computer.
- Connect to the EDBG/Jlink Virtual COM port and configure the serial settings as follows:
- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None
- Open the CAN Analyzer Software and perform following steps
- Configure CAN Analyzer Software as per Hardware Setup mention in below screenshot
- Send CAN message from CAN Analyzer Software
- Received message will be echoed back to the CAN analyzer software and terminal window
-
Following will be terminal session’s output
- LED toggles for every message received
Following table provides LED name:
Board | LED Name |
---|---|
SAMA5D2 Xplained Ultra Evaluation Kit | RGB_LED(Green) |