|
XC161 Datasheet, PDF (258/419 Pages) Infineon Technologies AG – 16-Bit Single-Chip Microcontroller with C166SV2 Core Volume 2 (of 2): Peripheral Units | |||
|
◁ |
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
TwinCAN Module
21.1.4.3 Handling of Transmit Message Objects
A message object with direction flag DIR = â1â (message configuration register
MSGCFGn) is handled as transmit object.
All message objects with bitfield MSGVAL = â10â are operable and taken into account by
the CAN node controller operation described below.
During the initialization phase, the transmit request bitfield (TXRQ), the new information
bitfield (NEWDAT) should be reset to â01â and the update in progress by CPU bitfield
(CPUUPD) in register MSGCTRn should be reset to â10â. The message bytes to be
transmitted are written into the data partition of the message object (MSGDRn0,
MSGDRn4). The number of message bytes to be transmitted has to be written to bitfield
DLC in register MSGCFGn. The selected identifier has to be written to register MSGARn.
Then, bitfield NEWDAT in register MSGCTRn should be set to â10â and bitfield CPUUPD
should be reset to â01â by the CPU.
When the remote monitoring mode is enabled (RMM = â1â in MSGCFGn), the identifier
and the data length code of a received remote frame will be copied to the corresponding
transmit message object, if a matching identifier was found during the compare and
mask operation with all CAN message objects. The copy procedure may change the
identifier in the transmit message object, if some MSGAMRn mask register bits have
been set to â0â.
As long as bitfield MSGVAL in register MSGCTRn is set to â10â, the reception of a remote
frame with matching identifier automatically sets bitfield TXRQ to â10â. Simultaneously,
bitfield RMTPND in register MSGCTRn is set to â10â in order to indicate the reception of
an accepted remote frame. Alternatively, TXRQ may be set by the CPU via a write
access to register MSGCTRn. If the transmit request bitfield TXRQ is found at â10â (while
MSGVAL = â10â and CPUUPD = â01â) by the appropriate CAN controller node, a data
frame based upon the information stored in the respective transmit message object is
generated and automatically transferred when the associated CAN bus is idle.
If bitfield CPUUPD in register MSGCTRn is set to â10â, the automatic transmission of a
message object is prohibited and flag TXRQ is not evaluated by the respective CAN
node controller. The CPU can release the pending transmission by clearing CPUUPD.
This allows the user to listen on the bus and to answer remote frames under software
control.
When the data partition of a transmit message object has to be updated by the CPU,
bitfield CPUUPD in message control register MSGCTRn should be set to â10â, inhibiting
a read or write access of the associated CAN node controller. If a remote frame with an
accepted identifier arrives during the update of a message objectâs data storage, bitfields
TXRQ and RMTPND are automatically set to â10â and the transmission of the
corresponding data frame is pending until CPUUPD is reset again.
Userâs Manual
TwinCAN_X1, V2.1
21-18
V2.2, 2004-01
|
▷ |