beautypg.com

13 precautions when using can controller – FUJITSU F2MCTM-16LX User Manual

Page 519

background image

503

21.13

Precautions when Using CAN Controller

Use of the CAN Controller requires the following cautions.

Caution for Disabling Message Buffers by BVAL Bits

The use of BVAL bits may affect malfunction of CAN Controller when messages buffers are set disabled

while CAN Controller is participating in CAN communication. This section shows the work around of this

malfunction.

Condition

When following 2 conditions occur at the same time, the CAN Controller will not perform to transmit

messages normally.

CAN Controller is participating in the CAN communication. (i.e. The read value of the CSR: HALT bit

is 0 and CAN Controller is ready to transmit messages)

Message buffers are read when BVAL bits disable the message buffers.

Work around

Operation for suppressing transmission request

Do not use BVAL bit for suppressing transmission request, use TCAN bit instead of it.

Operation for composing transmission message

For composing a transmission message, it is necessary to disable the message buffer by BVAL bit to

change contents of ID and IDE registers. In this case, BVAL bit should reset (BVAL=0) after checking

if TREQ bit is 0 or after completion of the previous message transmission (TC=1).

In case a buffer needs to be disabled, ensure that no transmission request is pending (if it was requested

before). Therefore, do not reset BVALx-Bit before testing, if a transmission is ongoing;

a) Cancel the transmission request (TCANx=1;), if necessary

b) and wait for the transmission completion (while (TREQx==1);) by polling or interrupt.

Only after that the transmission buffer can be disabled (BVALx=0;).

Note:

For case a), if transmission of that buffer has already started, canceling the request is ignored and

disabling the buffer is delayed until the end of the transmission.