What is the importance of SFRPAGE in C8051f120?

Status
Not open for further replies.

prasadsrkrec

Junior Member level 2
Joined
May 18, 2012
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,421
char SFRPAGE_SAVE = SFRPAGE; // preserve SFRPAGE


what is the importance of this in 8051f120 ?
any one explain clearly?
 

It seems to me, from what I read, that the special functions register is pushed onto the stack everytime an interrupt occurs. The data sheet for your processor seems to have alot of information regarding the SFR; I would take a look at it if you are looking for more information. Good Luck.

https://www.silabs.com/Support%20Documents/TechnicalDocs/C8051F12x-13x.pdf
 

The original 8051 family of microcontrollers provided direct access to the Special Function Registers (SFR) through memory addresses 0x80 to 0xFF. However, the additional number of SFRs specific to a Silicon Labs C8051 device and its additional peripherals exceeds the available address allotment, therefore these additional SFRs are managed by a Page system which divides the SFRs into sections or pages still accessible by the same 0x80 to 0xFF address window. Doing so maintains compatible with the original Intel MCS-51 instruction set, while offering the ability to expand the number of SFRs to meet the requirements of a particular device and its peripheral modules.

The C8051F120 utilizes five of these SFR "Pages", the following statement simply save the current context or page number to facilitate returning back to the original SFR Page.

Code:
char SFRPAGE_SAVE = SFRPAGE; // preserve SFRPAGE

By executing the following:

Code:
SFRPAGE = SFRPAGE_SAVE;  // return to saved SFRPAGE

SFRPAGE is simply a register which stores the current SFR Page Number or Context, it is one byte in size therefore the contents can be stored in a single byte type like char, in this case the variable SFRPAGE_SAVE.

For example to configure a DAC module, you would first same the current Page Context, then change the Page Context to the page containing registers required to configure the DAC module, then after the DAC module has accomplished, the saved Page Context is restored as shown above.

Additional information is available in the devices datasheet including a table showing the location of various registers by Page Context or Number:

Reference: C8051F120/1/2/3/4/5/6/7 C8051F130/1/2/3 Datasheet, Section: 11.2.6. Special Function Registers, Page: 136



Does this answer your question?


BigDog
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…