ST72521R9-Auto STMicroelectronics, ST72521R9-Auto Datasheet - Page 204

no-image

ST72521R9-Auto

Manufacturer Part Number
ST72521R9-Auto
Description
8-bit MCU for automotive
Manufacturer
STMicroelectronics
Datasheet

Specifications of ST72521R9-Auto

Hdflash Endurance
100 cycles, data retention 20 years
Clock Sources
crystal/ceramic resonator oscillators, internal RC oscillator and bypass for external clock
4 Power Saving Modes
Halt, Active Halt, Wait and Slow
Controller area network (CAN)
204/276
Workaround
The bus-off entry works correctly in almost all cases, only when REC is greater than 127 a
bus-off will not be recognized by pCAN. Therefore the pCAN bus-off signalling (BOFF) is still
used but it needs to be complemented by monitoring TEC by software.
To detect the bus-off condition by software the application has to monitor the value of the
TEC register periodically. An overflow signals a bus-off condition. When a bus-off condition
has been detected the application must execute the following sequence to recover from bus-
off properly: The application stops pCAN by clearing the RUN bit in the CANCSR register,
resets all pending transmission by clearing the LOCK bit in the BCSR register and starts it
again by setting the RUN bit.
To detect the bus-off condition properly, the TEC monitoring period must be lower than the
time between two overflows. As the problem only occurs when pCAN is in Error Passive
State (REC > 127) pCAN will continuously try to send a SOF followed by an Error Passive
Flag and a Suspend Transmission. This leads to 26 (1 + 6 + 8 + 3 + 8) bit times. Each time
TEC is incremented by 8, hence to reach 256 the sequence must be executed 32 times.
Under these conditions the shortest sequence leading to a TEC overflow lasts 832 bit times.
Depending on the baudrate, the application will have to adapt the monitoring period (for
example, at 500kbps the period must be less than 1600µs).
The ‘C’ code below shows an implementation example of the monitoring sequence. This
code is called periodically as described above.
To detect the overflow, the test condition must take into account that TEC might also have
been decremented due to a successful transmission. So an overflow condition is detected:
IF the current TEC value is lower than the previous TEC value
AND the difference is greater than the number of possible successful transmissions during
the monitoring period.
In the example above, one message can be sent, therefore one is added to CANTECR.
*
/* INITIALIZATION
/************************************************/
unsigned char TECReg=0; //Previous value of TEC
unsigned char BusOffFlag=0; //Set to one if bus-off
/************************************************/
/* BUS-OFF MONITORING SEQUENCE
/************************************************/
if( (CANCSR & BOFF) || ( CANTECR+1 < TECReg) )
{
}
else
{
}
***********************************************/
TECReg = CANTECR;
BusOffFlag = 1;
Doc ID 17660 Rev 1
ST72521xx-Auto

Related parts for ST72521R9-Auto