0 can module, 1 functional description, Can module – National CP3BT26 User Manual

Page 109: Functional description, Cp3 bt26

Advertising
background image

109

www.national.com

CP3

BT26

19.0 CAN Module

The CAN module contains a Full CAN class, CAN (Control-
ler Area Network) serial bus interface for low/high speed ap-
plications. It supports reception and transmission of
extended frames with a 29-bit identifier, standard frames
with an 11-bit identifier, applications that require high speed
(up to 1 MBit/s), and a low-speed CAN interface with CAN
master capability. Data transfer between the CAN bus and
the CPU is handled by 15 message buffers, which can be in-
dividually configured as receive or transmit buffers. Every
message buffer includes a status/control register which pro-
vides information about its current status and capabilities to
configure the buffer. All message buffers are able to gener-
ate an interrupt on the reception of a valid frame or the suc-
cessful transmission of a frame. In addition, an interrupt can
be generated on bus errors.

An incoming message is only accepted if the message iden-
tifier passes one of two acceptance filtering masks. The fil-
tering mask can be configured to receive a single message
ID for each buffer or a group of IDs for each receive buffer.
One of the buffers uses a separate message filtering proce-
dure. This provides the capability to establish a BASIC-CAN
path. Remote transmission requests can be processed au-
tomatically by automatic reconfiguration to a receiver after
transmission or by automated transmit scheduling upon re-
ception. A priority decoder allows any buffer to have one of
16 transmit priorities including the highest or lowest abso-
lute priority, for a total of 240 different transmit priorities.

A decided bit time counter (16-bit wide) is provided to sup-
port real time applications. The contents of this counter are
captured into the message buffer RAM on reception or
transmission. The counter can be synchronized through the
CAN network. This synchronization feature allows a reset of
the counter after the reception or transmission of a mes-
sage in buffer 0.

The CAN module is a fast CPU bus peripheral which allows
single-cycle byte or word read/write access. The CPU con-
trols the CAN module by programming the registers in the
CAN register block. This includes initialization of the CAN
baud rate, logic level of the CAN pins, and enable/disable of
the CAN module. A set of diagnostic features, such as loop-
back, listen only, and error identification, support develop-
ment with the CAN module and provide a sophisticated
error management tool.

The CAN module implements the following features:

„ CAN specification 2.0B

— Standard data and remote frames
— Extended data and remote frames
— 0 to 8 bytes data length
— Programmable bit rate up to 1 Mbit/s

„ 15 message buffers, each configurable as receive or

transmit buffers
— Message buffers are 16-bit wide dual-port RAM
— One buffer may be used as a BASIC-CAN path

„ Remote Frame support

— Automatic transmission after reception of a Remote

Transmission Request (RTR)

— Auto receive after transmission of a RTR

„ Acceptance filtering

— Two filtering capabilities: global acceptance mask and

individual buffer identifiers

— One of the buffers uses an independent acceptance

filtering procedure

„ Programmable transmit priority
„ Interrupt capability

— One interrupt vector for all message buffers (receive/

transmit/error)

— Each interrupt source can be enabled/disabled

„ 16-bit counter with time stamp capability on successful

reception or transmission of a message

„ Power Save capabilities with programmable Wake-Up

over the CAN bus (alternate source for the Multi-Input
Wake-Up module)

„ Push-pull capability of the input/output pins
„ Diagnostic functions

— Error identification
— Loopback and listen-only features for test and initial-

ization purposes

19.1

FUNCTIONAL DESCRIPTION

As shown in Figure 34, the CAN module consists of three
blocks: the CAN core, interface management, and a dual-
ported RAM containing the message buffers.

There are two dedicated device pins for the CAN interface,
CANTX as the transmit output and CANRX as the receive
input.

The CAN core implements the basic CAN protocol features
such as bit-stuffing, CRC calculation/checking, and error
management. It controls the transceiver logic and creates
error signals according to the bus rules. In addition, it con-
verts the data stream from the CPU (parallel data) to the se-
rial CAN bus data.

The interface management block is divided into the register
block and the interface management processor. The regis-
ter block provides the CAN interface with control information
from the CPU and provides the CPU with status information
from the CAN module. Additionally, it generates the interrupt
to the CPU.

The interface management processor is a state machine ex-
ecuting the CPU’s transmission and reception commands
and controlling the data transfer between several message
buffers and the RX/TX shift registers.

15 message buffers are memory mapped into RAM to trans-
mit and receive data through the CAN bus. Eight 16-bit reg-
isters belong to each buffer. One of the registers contains
control and status information about the message buffer
configuration and the current state of the buffer. The other
registers are used for the message identifier, a maximum of
up to eight data bytes, and the time stamp information. Dur-
ing the receive process, the incoming message will be
stored in a hidden receive buffer until the message is valid.
Then, the buffer contents will be copied into the first mes-
sage buffer which accepts the ID of the received message.

Advertising