Go to Embedded Systems Solutions (German Page)

Go to CANopenIA Home Page

CANopenIA-XA: CANopen Coprocessor
(formerly mode 3)

Also available as Philips LPC2xxx binaries

 

[ CANopenIA-XA | Direct I/O | Coprocessor ]

This mode allows using the CANopenIA as a CANopen peripheral coprocessor to a main host processor. If an existing microcontroller based hardware needs to be CANopen enabled, this mode allows for an easy integration: the CANopenIA chip is added to the hardware and communicates with the host processor via the UART port or via a shared RAM area.

Illustration of CANopenIA-XA - Mode 3

In case shared memory is used (for example using dual ported RAM), both the host processor and the CANopenIA chip have direct access to the process image - the entire set of input and output data exchanged between the two processors. The host only needs a very minimal knowledge about CANopen, it only reads and writes the process data. All transmissions are handled individually by the Coprocessor depedning on its configuration.

The functions (commands when using the UART) and callback functions (indications when using the UART channel) provided to the host processor are those defined by the "CANopen API Recommended Practice" published by Embedded Systems Academy.

Configuration

The configuration of the CANopenIA Coprocessor is very flexible. All process data is kept in a process image consisting of an array of bytes. Object Dictionary entries can be defined to address data in the process image as well as the PDO mapping can be directly mapped to individual bytes in the process image.

To activate a new configuration, an ASCII file containing the new configuration can be directly send to the CANopenIA-XA chip via an SDO download to a specific Object Dictionary entry.

Functions / Commands

The host processor only needs to deal with a minimal function interface providing direct access to the process data stored in the process image.

  1. BYTE COAPI_InitCANopen (BYTE bps, BYTE nodeid);
    Initializes the CANopen Coprocessor and selects the bit rate used on the CAN interface and the CANopen node ID to be used. In case zero is used for any of these parameters, the Coprocessor uses the last configured values.
     
  2. BYTE COAPI_ReadProcessData (BYTE offset, BYTE len, BYTE *pData);
    This function reads process data from the process image. The data is addressed by specifying the offset of the data in the process image and len being the number of bytes requested. The data is copied to the location indicated by the pointer pData.
     
  3. BYTE COAPI_WriteProcessData (BYTE offset, BYTE len, BYTE *pData);
    This function writes new process data to the process image. The data is addressed by specifying the offset of the data in the process image and len being the number of bytes to be written. The data is copied to the process image from the location indicated by the pointer pData.

Callback Functions / Indications

The coprocessor informs the host about system events using the following callback functions:

  1. void COAPICB_NMTChange (BYTE nmtstate);
    This indication is issued by the Coprocessor to inform the host about the current NMT (Network Management) state or NMT requests (like a reset). This way the host knows if the network is "operational" or if a NMT master requested that the node should reset itself.
     
  2. void COAPICB_ReceivedData (BYTE offset, BYTE len);
    This indication tells the host that new process data was received into the process image. The data was either received by an SDO download request or by a RPDO.
 

© Copyright, Embedded Systems Academy, Inc. and Embedded Systems Solutions GmbH