
Chapter 6. Power Management Page 6-7
functions, the PA3 and WU2 functions are
simultaneously
active. However, the WU2 function has
no effect unless enabled (by setting the WU2EN bit to 1). If WU2 is used as a wakeup pin, make
sure to set PA3 as an input (OEA.3=0, the default state) to prevent PA3 from also driving the pin.
The dual nature of the PA3/WU2 pin allows the FX2 to enter the low-power mode, then periodically
awaken itself. This is done by connecting an RC network to the PA3/WU2 pin; if the WU2 pin is set
to the default polarity (active-high), the resistor is connected to 3.3V and the capacitor is con-
nected to ground.
The firmware then performs the following steps:
1. Set W2POL to 1 for active-high polarity on the WU2 pin.
2. Set WU2EN to 1 to enable Wakeup 2.
3. Enable the wakeup interrupt by setting EICON.5=1.
4. Set PA3 to 0, then set OEA.3 to 1. This enables the PA3 output and drives the PA3/WU2 pin to
ground, discharging the capacitor.
5. Set OEA.3 to 0. This floats the PA3/WU2 pin, allowing the resistor to begin charging the
capacitor.
6. Write any value to the SUSPEND register, so the FX2 will unconditionally stop the oscillator
when the firmware sets PCON.0.
7. Set PCON.0 to 1. This commands the FX2 to enter the Idle state.
After the capacitor charges to a logic high level, the wakeup interrupt triggers via the WU2 pin.
8. In the Wakeup interrupt service routine, clear EICON.4 (the wakeup interrupt request flag),
then execute a ‘reti’ instruction. This resumes program execution at the instruction following
the instruction in step 7.
9. At this point, the firmware can check for any tasks to perform; if none are required, it can then
re-enter the Idle state starting at step 4.
By selecting a long time constant for the RC network attached to the WU2 pin, the FX2 chip can
operate at extremely low average power, since the on/off (active/suspend) duty-cycle is very short.
Comentários a estes Manuais