dsPIC30F Family Reference Manual
DS70070B-page 23-66 © 2004 Microchip Technology Inc.
23.13 Operation in CPU Power Saving Modes
23.13.1 Operation in Sleep Mode
Sleep mode is entered by executing a PWRSAV #0 instruction. This will stop the crystal oscillator
and shut down all system clocks. The user should ensure that the module is not active when the
CPU goes into Sleep mode. The pins will revert into normal I/O function, dependent on the value
in the TRIS register.
Because the CAN bus is not disruptable, the user must never execute a PWRSAV #0 instruction
while the module is in an Operating mode. The module must first be switched to Disable mode
by setting REQOP<2:0> =001 (CiCTRL<10:8>). When OPMODE<2:0> = 001 (CiCTRL<7:5>),
indicating that Disable mode is achieved, then the Sleep instruction may be used.
Figure 23-23 depicts how the CAN module will behave when the CPU enters Sleep mode and
how the module wakes up on bus activity. When the CPU exits Sleep mode due to activity on the
CAN bus, the WAKIF flag (CiINTF<6>) is set.
The module will monitor the CiRX line for activity while the device is in Sleep mode.
If the device is in Sleep mode and the WAKIE wake-up interrupt enable is set, the module will
generate an interrupt, waking the CPU. Due to the delays in starting up the oscillator and CPU,
the message activity that caused the wake-up will be lost.
If the module is in CPU Sleep mode and the WAKIE is not set, no interrupt will be generated and
the CPU and the CAN module will continue to sleep.
If the CAN module is in Disable mode, the module will wake-up and, depending on the condition
of the WAKIE bit, may generate an interrupt. It is expected that the module will correctly receive
the message that caused the wake-up from Sleep mode.
The module can be programmed to apply a low-pass filter function to the CiRX input line while
the module or the CPU is in Sleep mode. This feature can be used to protect the module from
wake-up due to short glitches on the CAN bus lines. Such glitches can result from
electromagnetic inference within noisy environments. The WAKFIL bit (CiCFG2<14>) enables or
disables the filter.