Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 1: PIC16F887 Microcontroller - Device Overview
Fig. 1-6 SFR and General Purpose Registers
General-Purpose Registers
General-Purpose registers are used for storing temporary data and results created during operation. For example, if the
program performs a counting (for example, counting products on the assembly line), it is necessary to have a register
which stands for what we in everyday life call “sum”. Since the microcontroller is not creative at all, it is necessary to
specify the address of some general purpose register and assign it a new function. A simple program to increment the
value of this register by 1, after each product passes through a sensor, should be created.
Therefore, the microcontroller can execute that program because it now knows what and where the sum which must be
incremented is. Similarly to this simple example, each program variable must be preassigned some of general-purpose
register.
SFR Registers
Special-Function registers are also RAM memory locations, but unlike general-purpose registers, their purpose is
predetermined during manufacturing process and cannot be changed. Since their bits are physically connected to
particular circuits on the chip (A/D converter, serial communication module, etc.), any change of their contents directly
affects the operation of the microcontroller or some of its circuits. For example, by changing the TRISA register, the
http://www.mikroe.com/en/books/picmcubook/ch1/ (9 of 14)5/3/2009 11:31:25 AM