Internal RAM

2.4.4Special Function Register (SFR) Memory

SFRs are areas of memory that control specific functionality of the MSC1210. For example, four SFRs permit access to the 32 input/output lines (eight lines per SFR) of the MSC1210. Another SFR allows a program to read or write to the MSC1210 serial port. Other SFRs allow the user to set the serial baud rate, control and access timers, and configure the MSC1210 interrupt system.

When programming, SFRs have the illusion of being internal memory. For ex- ample, if writing the value 1 to internal RAM location 50H, execute the instruc- tion:

MOV 50h,#01h

Similarly, if writing the value 1 to the MSC1210 serial port, write this value to the SBUF SFR, which has an SFR address of 99H. Thus, to write the value 1 to the serial port, execute the instruction:

MOV 99h,#01h

As shown, it appears as if the SFR is part of internal memory. This is not the case. When using this method of memory access (it is called direct address- ing—more on that soon), any instruction that has an address of 00 H through 7FH refers to an internal RAM memory address; any instruction with an ad- dress of 80H through FFH refers to an SFR control register.

Note:

SFRs are used to control the way the MSC1210 functions. Each SFR has a specific purpose and format that will be discussed later. Not all addresses above 80H are assigned to SFRs. However, this area may not be used as additional RAM memory, even if a given address has not been assigned to an SFR.

Note:

Direct access addressing cannot be used to access internal RAM addresses 80H through FFH because direct access to addresses 80H through FFH re- fers to SFRs. The upper 128 bytes of internal RAM must be accessed using indirect addressing, which is explained in Chapter 5, Addressing Modes.

2-10

Page 36
Image 36
Texas Instruments MSC1210 manual Special Function Register SFR Memory