MCUXpresso SDK Documentation

co_device_basic

co_device_basic#

Overview#

The co_device_basic example shows CANopen device basic feature on the CANopenNode stack.

CANopen device setup TPDO1(0x1800), TPDO2(0x1801) and RPDO1(0x1400).
Device TPDO1 will send cyclic frames to manager when it receives SYNC frame with data 0x14(20).
Press A, trigger device TPDO2 acyclic transmission and send acyclic frames to manager RPDO2.

Device node ID is 0x04.

Running the demo#

== CANopenNode device basic EXAMPLE ==
 - Press A Update Manager RPDO (0x1401) mapping parameter (0x2002)

Press any key to start CANopen

Allocated 5344 bytes for CANopen objects
CANopenNode - Reset communication...
CANopenNode - Running...

Press A
Trigger PDO Synchronous Acyclic communication

Supported Boards#

FRDM-MCXA156
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA156 Board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them is mounted with the base board. To make example work, connections needed to be as follows on each base board:

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J22-2                  CANH        J22-2
CANL       J22-4                  CANL        J22-4
GND        J22-3                  GND         J22-3
Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device 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 demo.

FRDM-MCXE247
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXE247 Board

  • Personal Computer

Board settings

The example requires 2 boards.

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J17-1                  CANH        J17-1
CANL       J17-2                  CANL        J17-2
GND        J17-4                  GND         J17-4
Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device 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 demo.

FRDM-MCXE31B
Hardware requirements
  • Micro USB cable

  • FRDM-MCXE31B Board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them is mounted with the base board. To make example work, connections needed to be as follows on each base board:

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J17-1                  CANH        J17-1
CANL       J17-2                  CANL        J17-2
GND        J17-4                  GND         J17-4
Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with the following 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 demo.

MIMXRT1060-EVKB
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1060-EVKB board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them are mounted with the base board. Using a male to male CAN cable to connect the CAN2 instance (J42) between the 2 base boards.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB on the board.

  2. Open a serial terminal on PC for OpenSDA serial device 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.