Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CAN example
\par Purpose

This example demonstrates the basic functions of CAN controller.

\par Requirements

This package can be used with SAM3X or SAM4E evaluation kits.
CAN0 and CAN1 should be hooked-up externally before running
the example.

\par Description

In this example, it sends and receives messages over CAN bus to manage
the LED on the board and display CAN message on the terminal window.
There are four basic tests:
- test1: Test the transmission from CAN0 Mailbox 0 to CAN1 Mailbox 0.
- test2: Test the transmission from CAN0 Mailboxes 1 & 2 to CAN1 Mailbox 7
  without overwrite.
- test3: Test the transmission from CAN0 Mailboxes 1 & 2 to CAN1 Mailbox 7
  with overwrite.
- test4: Test the communication between CAN1 Mailbox 3 and CAN0 Mailbox 3.

\par Usage

-# Build the program and download it into the evaluation board.
-# On the computer, open and configure a terminal application
   (e.g., HyperTerminal on Microsoft Windows) with these settings:
  - 115200 bauds
  - 8 bits of data
  - No parity
  - 1 stop bit
  - No flow control
-# Connect CAN0 (J17 on SAM3X-EK or J13 on SAM4E-EK) and CAN1 (J20
   on SAM3X-EK or J14 on SAM4E-EK) in loop.
-# Start the application.
-# Upon startup, the application will output the following lines
   on the terminal window.
-- CAN Example --
-- SAMxx-EK --
-- Compiled: xxx xx xxxx xx:xx:xx --
  1. Press a key in the terminal window to run the tests. CAN messages will be displayed on the terminal window and LED0 or LED1 will toggle according to the messages.