C8051F040/1/2/3/4/5/6/7
SFRPAGE
pushed to
SFRNEXT
SFRNEXT
pushed to
SFRLAST
SFR Page 0x00
Automatically
pushed on stack in
SFRPAGE on PCA
interrupt
0x00
(PCA)
0x02
(ADC2)
0x0F
(Port 5)
SFRPAGE
SFRNEXT
SFRLAST
Figure 12.6. SFR Page Stack Upon PCA Interrupt Occurring During an ADC2 ISR
On exit from the PCA interrupt service routine, the CIP-51 will return to the ADC2 Window Comparator
ISR. On execution of the RETI instruction, SFR Page 0x00 used to access the PCA registers will be auto-
matically popped off of the SFR Page Stack, and the contents of the SFRNEXT register will be moved to
the SFRPAGE register. Software in the ADC2 ISR can continue to access SFR’s as it did prior to the PCA
interrupt. Likewise, the contents of SFRLAST are moved to the SFRNEXT register. Recall this was the
SFR Page value 0x0F being used to access Port 5 before the ADC2 interrupt occurred. See Figure 12.7
below.
Rev. 1.5
139