C8051F120/1/2/3/4/5/6/7
130
Rev. 1.2
12.2.6.3.SFR Page Stack Example
The following is an example that shows the operation of the SFR Page Stack during interrupts.
In this example, the SFR Page Control is left in the default enabled state (i.e., SFRPGEN = 1), and the CIP-51 is exe-
cuting in-line code that is writing values to Port 5 (SFR “P5”, located at address 0xD8 on SFR Page 0x0F). The
device is also using the Programmable Counter Array (PCA) and the 10-bit ADC (ADC2) window comparator to
monitor a voltage. The PCA is timing a critical control function in its interrupt service routine (ISR), so its interrupt is
enabled and is set to
high
priority. The ADC2 is monitoring a voltage that is less important, but to minimize the soft-
ware overhead its window comparator is being used with an associated ISR that is set to
low
priority. At this point, the
SFR page is set to access the Port 5 SFR (SFRPAGE = 0x0F). See Figure 12.6 below.
0x0F
(Port 5)
SFRPAGE
SFRLAST
SFRNEXT
SFR Page
Stack SFR's
Figure 12.6. SFR Page Stack While Using SFR Page 0x0F To Access Port 5
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 ...