Engineer-to-Engineer Note EE-227
a
Technical notes on using Analog Devices DSPs, processors and development tools
Contact our technical support at dsp.support@analog.com and at dsptools.support@analog.com
Or vi sit our o n-li ne r esou rces htt p:/ /www.analog.com/ee-notes and http://www.analog.com/processors
CAN Configuration Procedure for ADSP-21992 DSPs
Contributed by Petre M. and Stephen F. Rev 1 – January 22, 2004
Introduction
ADSP-21992 DSPs contain a Controller Area Network (CAN) module. This document supplements the
ADSP-2199x DSP Hardware Reference Manual [1] and shows how to configure the CAN module on
ADSP-21992 DSPs. The Appendix includes an updated version of the Peripheral Interrupt Sources table
to include the CAN module interrupt sources (Table 6). For information on CAN module registers, refer to
the ADSP-2199x DSP Hardware Reference Manual.
CAN Module
Key features of the CAN module on ADSP-21992 DSPs include:
• Conforms to the CAN V2.0B standard
• Supports standard (11-bit) and extended (29-bit) identifiers
• Supports data rates of up to 1Mbit/sec (and higher)
• 16 configurable mailboxes (all receive or transmit)
• Dedicated acceptance mask for each mailbox
• Data filtering (first 2 bytes) can be used for acceptance filtering
• Error status and warning registers
• Transmit priority by identifier
• Universal Counter Module
• Readable receive and transmit counters
The CAN module is an asynchronous, low bit rate serial interface intended for use in applications with bit
rates under 1 Mbit/ sec. The CAN protocol incorporates a data CRC check, message error tracking and
fault node confinement as means to improve network reliability to the level required for control
applications.
The CAN module architecture is based around a 16-entry mailbox RAM. The mailbox is accessed
sequentially by the CAN serial interface or the host CPU. Each mailbox consists of eight 16-bit data
words. The data is divided into fields, which includes a message identifier, a time stamp, a byte count, up
to eight bytes of data, and several control bits. Each node monitors the messages being passed on the
network. If the identifier in the transmitted message matches an identifier in one of it's mailboxes, the
module knows that the message was meant for it, passes the data into its appropriate mailbox, and signals
the host of its arrival with an interrupt.
Copyright 2004, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of
customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property
of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however
no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.
The CAN network itself is a single, differential pair line. All nodes continuously monitor this line. There
is no clock wire. Messages are passed in one of four standard message types (frames). Synchronization is
achieved by an elaborate sync scheme performed in each CAN receiver. Message arbitration is
accomplished one bit at a time. A dominant polarity is established for the network. All nodes are allowed
to start transmitting at the same time following a frame sync pulse.
As each node transmits a bit, it checks to see if the bus is the same state that it transmitted. If it is, it
continues to transmit. If not, then another node has transmitted a dominant bit, so the first node knows it
has lost the arbitration and it stops transmitting. Arbitration continues, bit by bit, until only one node is
left transmitting.
Because the electrical characteristics of each network connection are very stringent, the CAN interface is
typically divided into two parts: a controller and a transceiver. This allows a single controller to support
different drivers and CAN networks. The ADSP-21992 DSP CAN module represents only the controller
part of the interface. This module's network I/O is a single transmit line and a single receive line, which
communicate to a line transceiver.
a
Configuring the CAN Module
After power-up, the CAN module must be configured. This operation is accomplished by specifying
whether the CANTX pin is to be used as open drain output or push pull and initializing the bit
configuration registers.
By default, the CANTX pin of ADSP-21992 is open drain after reset, supporting single-wire network
topologies. As more likely an off-chip CAN transceiver device is connected to implement the physical
layer the CANTX_CTRL bit of the SYSREG0 register (IOPG=0xE) is usually set.
Bit Name Function Type Reset
State
0 CANTX_CTRL 0 - CANTX is open drain
1 – CANTX is push pull
15-1 Reserved Read 0
Table 1: SYSREG0 register
After Power-Up, the CAN module must be configured. This entails setting the module in configuration
mode, initializing the bit configuration registers CANBCR0 (Table 2), CANBCR1 (Table 3), and then
enabling normal mode. If the CAN module is not properly configured, it cannot be connected to the CAN
bus line. In this mode, the length of the bit (baud rate), the location of the sample point inside the bit, and
the synchronization jump width (SJW) are defined.
Read/Write 0
CAN Configuration Procedure for ADSP-21992 DSPs (EE-227) Page 2 of 6