768
Chapter 19
CAN Controller (CAN)
Preliminary User’s Manual U17566EE1V2UM00
19.18 Operating Precautions
19.18.1
Wake-up from sleep mode
(1)
Description
When the CAN macro is set into SLEEP mode, it can be waken up by CAN bus
activity.
This waking up is asynchronous to the operation of the macro and the CPU. By
configuration setting, a WAKEUP interrupt can be generated by the CAN
macro on the wakeup event.
While the interrupt is generated asynchronously, the CAN macro may need
another dominant edge on the CAN bus, in order to restart its synchronous
operation. The necessity of another dominant edge on the CAN bus to wake up
depends on the phase between internal clocking of the CAN macro and the
signal on the CAN bus.
During the time, after the interrupt already has been indicated, and before the
CAN macro has restarted its synchronous operation, the registers of the CAN
macro will not operate.
The worst case (maximum length) of this latency time is given by the CAN bus
speed and the rule of the CAN bus about the frequency of recessive to
dominant edges. Given by the stuffing rule, at least every 10 bits, a recessive
to dominant edge must occur.
This means in an example:
• CAN Bus Speed: 1 Mbit/s
10 CAN Bits within: 10 µs
Worst case wakeup latency: 10 µs
(2)
Software improvement hint
Within the WAKEUP interrupt routine, create a waiting loop, which tests the
capability of clearing the WAKEUP interrupt flag within CAN, by checking the
actual power save mode.
In the following C-code example, replace the objects in “<>” brackets by the
hardware locations within your implementation. Use the appropriate access
types, as described in the user’s manual.
do
{
AFCAN_SleepStatus = <CnCTRL_PSMOD
E
>
if( AFCAN_SleepStatus != 0 )
{
/* mac
r
o is still in SL
EE
P mode (waiting fo
r
latency time) */
<CnINTS_CINTS5> = 1; /*
r
epeated t
r
ying to clea
r
CINTS5 */
}
} while( AFCAN_SleepStatus != 0 );
electronic components distributor