Unit-II-ESM-Architecture of PIC Microcontroller 2
Unit-II-ESM-Architecture of PIC Microcontroller 2
2. MEMORY ORGANIZATION:
PIC microcontroller memory module consists of mainly 3 types of
memories:
PROGRAM MEMORY:
It contains the written program after we burned it in microcontroller. Program
Counter executes commands stored in the program memory, one after the
other. Pic microcontroller can have 8K words x 14 bits of Flash program
memory that can be electrically erased and reprogrammed. Whenever we
burn program into the micro, we erase an old program and write a new one.
DATA MEMORY:
It is a RAM type which is used to store the data temporarily in its registers.
The RAM memory is classified into banks. Each bank extends up to 7Fh (128
bytes). Number of banks may vary depending on the microcontroller.
PIC16F84 has only two banks. Banks contain Special Function Registers
(SFR) and General Purpose Registers (GPR). The lower locations of each
bank are reserved for the Special Function Registers and upper locations are
for General Purpose Registers.
These registers are used for special purposes and they cannot be used as
normal registers. Their function is set at the time of manufacturing. They
perform the function assigned to them and user cannot change the function of
SFR. Three important SFRs for programming are:
3. SERIAL COMMUNICATION:
The transfer of one bit of data at time consecutively over a communication
channel is called Serial Communication. There are three protocols of serial
communication:
Serial Communication
4. INTERRUPTS:
There are 20 internal interrupts and three external interrupt sources in PIC
microcontrollers which are related with different peripherals like ADC, USART,
Timers, and CCP etc.
5. I/O PORTS:
Let us take PIC16 series, it consists of five ports, such as Port A, Port B, Port
C, Port D and Port E.
Port A:This port is 7-bit wide and can be used for both input and output.
The status of TRISA register decided whether it is used as input or
output port.
Port B:It is an 8-bit port. This port also can be used as input and output.
Moreover in input mode four of its bits are variable according to the
interrupt signals.
Port C:It is also an 8-bit port and can be used as both input and output
port which is determined by the status of the TRISC register.
Port D:This 8-bit port, unlike Port A, B and C is not an input/output port,
but is used as acts as a slave port for the connection to
the microprocessor When in I/O mode Port D all pins should have
Schmitt Trigger buffers.
Port E:It is a 3-bit port which is used as the additional feature of the
control signals to the A/D converter.
6. CCP MODULE:
A CCP module works in the following three modes:
8. D/A CONVERTER:
There are no analog outputs in PIC Microcontroller. To get analog output
we have to use external Digital-to-Analog Converter (DAC). It can convert 8
bits of digital number from the eight digital outputs of PIC microcontroller.
9. A/D CONVERTER: