NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 777 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
Silent Mode, or Basic Mode) are selected.
5.24.7 CAN Communications
Managing Message Objects
5.24.7.1
The configuration of the Message Objects in the Message RAM (with the exception of the bits MsgVal,
NewDat, IntPnd, and TxRqst) will not be affected by resetting the chip. All the Message Objects must
be initialized by the application software or they must be “not valid” (MsgVal = ‘0’) and the bit timing
must be configured before the application software clears the Init bit in ter.
The configuration of a Message Object is done by programming Mask, Arbitration, Control and Data
fields of one of the two interface registers to the desired values. By writing to the corresponding IFn
Command Request Register, the IFn Message Buffer Registers are loaded into the addressed
Message Object in the Message RAM.
When the Init bit in the CAN Control Register is cleared, the CAN Protocol Controller state machine of
the CAN_Core and the state machine of the Message Handler control the internal data flow of the
C_CAN. Received messages that pass the acceptance filtering are stored into the Message RAM,
messages with pending transmission request are loaded into the CAN_Core’s Shift Register and are
transmitted through the CAN bus.
The application software reads received messages and updates messages to be transmitted through
the IFn Interface Registers. Depending on the configuration, the application software is interrupted on
certain CAN message and CAN error events.
Message Handler State Machine
5.24.7.2
The Message Handler controls the data transfer between the Rx/Tx Shift Register of the CAN Core,
the Message RAM and the IFn Registers.
The Message Handler FSM controls the following functions:
•
Data Transfer from IFn Registers to the Message RAM
•
Data Transfer from Message RAM to the IFn Registers
•
Data Transfer from Shift Register to the Message RAM
•
Data Transfer from Message RAM to Shift Register
•
Data Transfer from Shift Register to the Acceptance Filtering unit
•
Scanning of Message RAM for a matching Message Object
•
Handling of TxRqst flags
•
Handling of interrupts.
Data Transfer from/to Message RAM
5.24.7.3
When the application software initiates a data transfer between the IFn Registers and Message RAM,
the Message Handler sets the Busy bit in the respective Command Request Register
(CAN_IFn_CRR) to ‘1’. After the transfer has completed, the Busy bit is again cleared (see the
following figure).
The respective Command Mask Register specifies whether a complete Message Object or only parts
of it will be transferred. Due to the structure of the Message RAM, it is not possible to write single
bits/bytes of one Message Object. It is always necessary to write a complete Message Object into the