When considering the PIC microcontroller there are a number of terms which have specific meaning. This can be confusing, because the same terms can have quite a different meaning when applied to other computers and operating systems. As C programmers we don't have to know a huge amount about how this is organized, but we do need to know the underlying principles.
As we saw previously there are two data memory areas in a PIC microcontroller. Your program can write to these areas and read values back from them. The areas are, in order, the Special Function Registers (SFR) and the General Purpose Registers (GPR).
Each of the registers is identified by a specific numeric address, and the address values range from 0x00 to 0x7F. The Special Function Registers are held at the "bottom" of memory (i.e. they have lower addressed) and the General Purpose Registers are held above them. Strictly speaking they are referred to as File Registers . These are not files in the computer data sense of the word, but numbered locations which a PIC microcontroller program can refer to. In the text I will refer to them simply as registers.
On the right you can see the descriptions of these two areas of memory. Note that as far as your program is concerned you can use special function and general purpose registers interchangeably.
General Purpose Registers |
SRAM - 368 bytes (in the PIC16F88) used to store variables. This is where your variables are stored when your program is running. The PICmicro documentation calls them General Purpose Registers. in that you can use them to hold whatever values your program is working on. |
Special Function Registers |
SRAM - 45 bytes used to hold Special Function Registers (SFR) which control the operation of hardware devices in the PICmicro. We will use these registers to configure and interact with the PICmicro hardware. |