Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FlexCAN Example

Overview

This FlexCAN example application demonstrates the SDK Peripheral drivers working with different methods. FlexCAN network and FlexCAN loop-back are the two provided examples:

The board transfers and receives characters through the FlexCAN-UART interface. Type the characters on the keyboard and the board receives and displays them on the terminal screen. Look for instructions output to the terminal.

Supported Platforms

These Tower System modules are supported by the FlexCAN example:

System Requirement

Hardware requirements

Toolchain requirements

Software requirements

Getting Started

Hardware settings

TWR-SER Tower System module configuration (only FlexCAN network example)

Although not required, the recommendation is to leave the development board jumper settings and configurations in default state when running this example.

Prepare the example

  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.
  2. Open a serial terminal with these settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  3. Download the program to the target board.
  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Run the example

FlexCAN loopback

These instructions are displayed/shown on the terminal window:

Running the FlexCAN loopback example.
*********FLEXCAN LOOPBACK EXAMPLE*********
Message format: Standard (11 bit id)
Message buffer 8 used for Rx.
Message buffer 9 used for Tx.
Interrupt Mode: Enabled
Operation Mode: TX and RX --> Normal
FlexCAN MB receive config
FlexCAN send config
Data transmit: 0a 0b 0c 0d 0e 0f 10 11
DLC=8, mb_idx=8
RX MB data: 0x0a 0b 0c 0d 0e 0f 10 11
ID: 0x123Press any key to run again!

FlexCAN network

After connecting the two boards, these instructions display on each terminal window. One board must be chosen as node A and the other board as node B. Data is sent continuously between the node A and the node B.

This message displays on the node A terminal:

*********FlexCAN : SCI2CAN demo *********
Message format: Standard (11 bit id)
Message buffer 8 used for Rx.
Message buffer 9 used for Tx.
OSJTAG Port used for Serial Console.
Interrupt Mode: Enabled
Operation Mode: TX and RX --> Normal
Please select local node as A or B:
Node:A
Data from Node B. Data from Node B. Data from Node B.

This message displays on the node B terminal:

*********FlexCAN : SCI2CAN demo *********
Message format: Standard (11 bit id)
Message buffer 8 used for Rx.
Message buffer 9 used for Tx.
OSJTAG Port used for Serial Console.
Interrupt Mode: Enabled
Operation Mode: TX and RX --> Normal
Please select local node as A or B:
Node:B
Data from Node B. Data from Node B. Data from Node B.