Thursday, March 26, 2009

PIC Microcontrollers

Memory Organization of a PIC microcontroller :

In a microcontroller there are two types of memory architectures :-

1. Von Neuman Architecture

2. Harvard Architecture

In Von Neuman architecture, data memory and code memory are shared by same bus. So its not possible to acces both these memories simultaneously. In otherwords, the data memory and code memory cannot have same address as it is shared by same bus.

In Harvard architecture, data memory and program memory are seperate and has got seperate buses. This makes processor to access data memory and program memory simultaneously thus making the whole process faster. Unlike in von neuman architecture, the code memory and program memory can have same address.

The PIC microcontrollers employ harvard architecture and is thus faster.

Data Memory :

The data memory in the PIC microcontroller is broken down into a number of banks. The data memory of PIC microcontroller is divided into two distinct areas ;

1 General Purpose Registers ( GPR )

2 Special Function Registers (SFR )

The GPR is used to store intermediate data and other variables whereas the SFR controls the operation of the microcontroller, such as controlling various peripherals units such as timers, ADCs, USART etc.,

In a 16F877A microcontrollers, the data memory is 368 bytes.

Flash Memory :

The flash memory is a non-volatile memory, ehich serves as program memory. Earlier, EEPROM is used as code memory. Now EEPROM is replaced with flash memory, which provides good amount of flexibilty and ease of reprogramming. A flas memory can be programmed atleast 10000 number of times. The flash memory of the PIC microcontroller contains constant data and strings in addition to executable codes.

No comments: