Special function register
   HOME

TheInfoList



OR:

A special function register (SFR) is a
register Register or registration may refer to: Arts, entertainment, and media Music * Register (music), the relative "height" or range of a note, melody, part, instrument, etc. * ''Register'', a 2017 album by Travis Miller * Registration (organ), ...
within a
microcontroller A microcontroller (MC, uC, or μC) or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. Pro ...
that controls or monitors various aspects of the microcontroller's function. Depending on the processor architecture, this can include, but is not limited to: * I/O and peripheral control (such as serial ports or general-purpose IOs) * timers *
stack pointer A stack register is a computer central processor register whose purpose is to keep track of a call stack. On an accumulator-based architecture machine, this may be a dedicated register. On a machine with multiple general-purpose registers, it m ...
* stack limit (to prevent overflows) *
program counter The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, ...
*
subroutine In computer programming, a function (also procedure, method, subroutine, routine, or subprogram) is a callable unit of software logic that has a well-defined interface and behavior and can be invoked multiple times. Callable units provide a ...
return address In postal mail, a return address is an explicit inclusion of the address of the person sending the message. It provides the recipient (and sometimes authorized intermediaries) with a means to determine how to respond to the sender of the message ...
* processor status (servicing an interrupt, running in protected mode, etc.) * condition codes (result of previous comparisons) Because special registers are closely tied to some special function or status of the microcontroller, they might not be directly ''writeable'' by normal instructions (such as adds, moves, etc.). Instead, some special registers in some microcontroller architectures require special instructions to modify them. For example, the program counter is not directly writeable in many microcontroller architectures. Instead, the programmer uses instructions such as return from subroutine, jump, or branch to modify the program counter. For another example, the condition code register might not be directly writable, instead being updated only by compare instructions.


Intel microcontrollers

Special function registers are in the upper area of addressable memory, from address 0x80 to 0xFF. This area of memory cannot be used for data or program storage, but is instead a series of memory-mapped ports and registers. All port input and output can therefore be performed by memory move operations on specified addresses in the SFR region. Also, different status registers are mapped into the SFR, for use in checking the status of the 8051, and changing some operational parameters of the 8051. Some SFR bits may be set directly using SETB/LDB instructions on the SFR's address, whereas others may require usage of specific instructions. The Intel 80196 class microcontroller has 24 SFRs, each 1 byte in size; standard
Intel 8051 The Intel MCS-51 (commonly termed 8051) is a single-chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems. The architect of the Intel MCS-51 instruction set was John H. Wharton.. Intel's original versions w ...
chips have 21 SFRs.


External links


i8051 SFRs
*

Microcontrollers {{Microcompu-stub