C8051F120/1/2/3/4/5/6/7
134
Rev. 1.2
On the execution of the RETI instruction in the ADC2 Window Comparator ISR, the value in SFRPAGE register is
overwritten with the contents of SFRNEXT. The CIP-51 may now access the Port 5 SFR bits as it did prior to the
interrupts occurring. See Figure 12.10 below.
Note that in the above example, all three bytes in the SFR Page Stack are accessible via the SFRPAGE, SFRNEXT,
and SFRLAST special function registers. If the stack is altered while servicing an interrupt, it is possible to return to
a different SFR Page upon interrupt exit than selected prior to the interrupt call. Direct access to the SFR Page stack
can be useful to enable real-time operating systems to control and manage context switching between multiple tasks.
Push operations on the SFR Page Stack only occur on interrupt service, and pop operations only occur on interrupt
exit (execution on the RETI instruction). The automatic switching of the SFRPAGE and operation of the SFR Page
Stack as described above can be disabled in software by clearing the SFR Automatic Page Enable Bit (SFRPGEN) in
the SFR Page Control Register (SFRPGCN). See Figure 12.11.
0x0F
(Port 5)
SFRPAGE
SFRLAST
SFRNEXT
SFR Page 0x02
Automatically
popped off of the
stack on return from
interrupt
SFRNEXT
popped to
SFRPAGE
Figure 12.10. SFR Page Stack Upon Return From ADC2 Window Interrupt
Summary of Contents for C8051F120
Page 2: ...C8051F120 1 2 3 4 5 6 7 2 Rev 1 2 Notes ...
Page 8: ...C8051F120 1 2 3 4 5 6 7 8 Rev 1 2 26 2 Flash Programming Commands 318 26 3 Debug Support 321 ...
Page 16: ...C8051F120 1 2 3 4 5 6 7 16 Rev 1 2 Notes ...
Page 48: ...C8051F120 1 2 3 4 5 6 7 48 Rev 1 2 ...
Page 98: ...C8051F120 1 2 3 4 5 6 7 98 Rev 1 2 ...
Page 106: ...C8051F120 1 2 3 4 5 6 7 106 Rev 1 2 Notes ...
Page 183: ...C8051F120 1 2 3 4 5 6 7 Rev 1 2 183 Notes ...
Page 184: ...C8051F120 1 2 3 4 5 6 7 184 Rev 1 2 ...
Page 214: ...C8051F120 1 2 3 4 5 6 7 214 Rev 1 2 Notes ...