beautypg.com

Section 19: controller area network (can) module – Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual

Page 136

background image

High-Speed Microcontroller User’s

Guide: Network Microcontroller

Supplement

136

SECTION 19: CONTROLLER AREA NETWORK (CAN) MODULE

The DS80C400 and DS80C410 incorporate a single CAN controller (CAN 0), which provides operating modes that are fully compliant

with the CAN 2.0B specification. The microcontroller interface to the CAN controller is broken into two groups of registers. To simplify

the software associated with the operation of the CAN controller, all of the global CAN status and controls, as well as the individual

message center control/status registers, are located in the SFR map. The remaining registers associated with the data identification,

identification masks, format and data are located in the MOVX space. Each of the SFR and MOVX registers are configured as dual port

memories to allow both the CAN controller and the microcontroller access to the required functions.

The basic functions covered by the CAN controller begin with the capability to use 11-bit standard or 29-bit extended acceptance iden-

tifiers, as programmed by the microcontroller for each message center. The CAN unit provides 15 message centers, each having a

standard 8-byte data field. The first 14 message centers are programmable in either a transmit or receive mode. Message center 15

is designed as a receive-only message center and implements a second data buffer to prevent the inadvertent loss of data when the

microcontroller is busy. This FIFO buffer is utilized when the microcontroller is not allowed time to retrieve the incoming message prior

to the acceptance of a second message into message center 15. Message center 15 also utilizes an independent set of mask regis-

ters and identification registers, which are only applied once an incoming message has not been accepted by any of the first 14 mes-

sage centers. A second filter test is also supported for all message centers (1–15) to allow the CAN controller to use two separate 8-

bit media masks and media arbitration fields to verify the contents of the first two bytes of data of each incoming message, before

accepting an incoming message. This feature allows the CAN unit to directly support the use of higher CAN protocols, which make

use of the first and/or second byte of data as a part of the acceptance layer for storing incoming messages. Each message center can

also be programmed independently to perform testing of the incoming data, with or without the use of the global masks.

Global controls and status registers in the CAN module allow the microcontroller to evaluate error messages, validate new data and

the location of such data, establish the bus timing for the CAN bus, establish the identification mask bits, and verify the source of indi-

vidual messages. In addition, each message center is individually equipped with the necessary status and controls to establish direc-

tions, interrupt generation, identification mode (standard or extended), data field size, data status, automatic remote frame request and

acknowledgment, and masked or nonmasked identification acceptance testing.

The priority order associated with the CAN module transmitting or receiving a message is determined by the inverse of the number of

the message center and is independent of the arbitration bits assigned to the message center. Thus, message center 2 has a higher

priority than message center 14. To avoid a priority inversion, the CAN module is designed to reload the transmit buffer with the mes-

sage of the highest priority (lowest message center number) whenever an arbitration is lost or an error condition occurs.

The following tables illustrate the locations of the MOVX SRAM registers and bits used by the CAN controller. Following the tables are

descriptions of the function of the bits and registers.

Maxim Integrated