When we talk about particular computer systems the work architecture is often used. This refers to the fact that we are concerned about the way that things are arranged within the system. Things that we are considering include how much memory of different kinds the system provides, the size of data chunks that are processed, the way that particular signals are used and so on.

While the various PIC microcontrollers share a common design thread, they do not all have identical architectures, in that the amount and arrangement of memory they support is different. The PIC microcontroller we are using in the PIC microcontroller development board, the 16F88, has the memory areas shown on the right.

The PIC microcontroller is different from most common microprocessors because the program memory and data memory are separate. On machines like the IBM PC the processor can store data (variables) or program instructions (code) anywhere. The PIC microcontroller does not do this. It is not possible for you to store program instructions in the data memory, or data values in the program memory. This approach, called the Harvard Architecture, allows the PIC microcontroller to access program instructions and data values simultaneously, and contributes to the high speed at which a PIC microcontroller can execute a program.

As far as we are concerned, this is not something which should affect us much, since the compiler will hide these details from us. If you are used to considering other processors however, you should keep this in mind, because it means that in a PIC microcontroller we have an address 0 in the program address space and another in the data address space, and they are not the address of the same item, as they would be in a more conventional design.

On the right you can see each of the areas available in the PIC microcontroller architecture, along with a description of each.

 

Program Memory

Flash - 16384 bytes used to store the program. This is where the C source code that we write ends up. Once converted into PIC microcontroller machine code our program is stored in this non-volatile memory area.

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 PIC microcontroller documentation calls them General Purpose Registers in that you can use them to hold whatever values your program is working on.

Non-volatile Data Memory

EEPROM - 256 bytes used to hold non-volatile data. This is a useful feature of the 16F88. If your device needs to remember things when the power is turned off, for example user settings, they can be stored in this special area of memory.

Special Function Registers

SRAM - 79 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.