Parallel Input/Output Control
MCF51CN128 Reference Manual, Rev. 6
9-13
Freescale Semiconductor
9.5.2.3
KBIx Interrupt Edge Select Register (KBIxES)
9.6
Pin Behavior in Stop Modes
Pin behavior following execution of a STOP instruction depends on the stop mode that is entered. An
explanation of pin behavior for the various stop modes follows:
•
Stop2 mode is a partial power-down mode, whereby I/O latches are maintained in their state as
before the STOP instruction was executed (port states are lost and need to be restored upon exiting
stop2). CPU register status and the state of I/O registers should be saved in RAM before the
executing the STOP instruction to place the MCU in Stop2 mode.
After recovery from Stop2 mode, before accessing any I/O, examine the state of the
SPMSC2[PPDF] bit.
— If the PPDF bit is cleared, I/O must be initialized as if a power-on-reset had occurred.
— If the PPDF bit is set, I/O register states should be restored from the values saved in RAM
before the STOP instruction was executed and peripherals may require initialization or
restoration to their pre-stop condition.
Then write a 1 to the SPMSC2[PPDACK] bit. Access to I/O is now permitted again in the user
application program.
•
In Stop3 and Stop4 modes, all I/O is maintained because internal logic circuity stays powered.
After recovery, normal I/O function is available to the user.
7
6
5
4
3
2
1
0
R
KBEDG7
KBEDG6
KBEDG5
KBEDG4
KBEDG3
KBEDG2
KBEDG1
KBEDG0
W
Reset:
0
0
0
0
0
0
0
0
Figure 9-12. KBIx Edge Select Register (KBIxES)
Table 9-17. KBIxES Field Descriptions
Field
Description
7–0
KBEDG
n
KBIx Edge Selects
— Each of the KBEDG
n
bits serves a dual purpose by selecting the polarity of the active
interrupt edge as well as selecting a pull-up or pull-down device if enabled.
0 A pull-up device is connected to the associated pin and detects falling edge/low level for interrupt generation.
1 A pull-down device is connected to the associated pin and detects rising edge/high level for interrupt
generation.