
ST10F252M
CAN modules
To initialize the CAN controller, the CPU has to set up the bit timing register and each
message object. If a message object is not needed, it is sufficient to set it’s MsgVal bit to not
valid. Otherwise, the whole message object has to be initialized.
Access to the bit timing register and to the BRP extension register for the configuration of
the bit timing is enabled when both bits Init and CCE in the CAN control register are set.
Resetting Init (by CPU only) finishes the software initialisation. Afterwards the bit stream
processor (BSP see
Section 18.9.10) synchronizes itself to the data transfer on the CAN
bus by waiting for the occurrence of a sequence of 11 consecutive recessive bits (
≡ Bus
Idle) before it can take part in bus activities and starts the message transfer.
The initialization of the message objects is independent of Init and can be done on the fly,
but the message objects should all be configured to particular identifiers or set to not valid
before the BSP starts the message transfer.
To change the configuration of a message object during normal operation, the CPU starts by
setting MsgVal to not valid. When the configuration is completed, MsgVal is set to valid
again.
18.7.2
CAN message transfer
Once the C-CAN is initialized and Init is reset to zero, the C-CAN’s CAN core synchronizes
itself to the CAN bus and starts the message transfer.
Received messages are stored into their appropriate message objects if they pass the
message handler’s acceptance filtering. The whole message including all arbitration bits,
DLC and eight data bytes is stored into the message object. If the identifier mask is used,
the arbitration bits which are masked to “don’t care” may be overwritten in the message
object.
The CPU may read or write each message any time via the interface registers, the message
handler guarantees data consistency in case of concurrent accesses.
Messages to be transmitted are updated by the CPU. If a permanent message object
(arbitration and control bits set up during configuration) exists for the message, only the data
bytes are updated and then TxRqst bit with NewDat bit are set to start the transmission. If
several transmit messages are assigned to the same message object (when the number of
message objects is not sufficient), the whole message object has to be configured before
the transmission of this message is requested.
The transmission of any number of message objects may be requested at the same time,
they are transmitted subsequently according to their internal priority. Messages may be
updated or set to not valid at any time, even when their requested transmission is still
pending. The old data is discarded when a message is updated before its pending
transmission has started.
Depending on the configuration of the message object, the transmission of a message may
be requested autonomously by the reception of a remote frame with a matching identifier.
18.7.3
Disabled automatic retransmission
According to the CAN specification (see ISO11898, 6.3.3 Recovery Management), the C-
CAN provides means for automatic retransmission of frames that have lost arbitration or that
have been disturbed by errors during transmission. The frame transmission service is
confirmed to the user before the transmission is successfully completed. By default, this