0% found this document useful (0 votes)
44 views20 pages

Chapter 2 Micro Architecture

The document discusses the architecture of PIC microcontrollers. It describes that PIC microcontrollers include a processor, memory, and peripherals. It then discusses features of the popular PIC16F877 microcontroller such as its operating speed, instruction set, timers, I/O port expansion, and memory organization. The document provides a detailed overview of the architecture and capabilities of PIC microcontrollers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views20 pages

Chapter 2 Micro Architecture

The document discusses the architecture of PIC microcontrollers. It describes that PIC microcontrollers include a processor, memory, and peripherals. It then discusses features of the popular PIC16F877 microcontroller such as its operating speed, instruction set, timers, I/O port expansion, and memory organization. The document provides a detailed overview of the architecture and capabilities of PIC microcontrollers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

DJM 50122

EMBEDDED SYSTEM
CHAPTER 2 APPLICATION

MICROCONTROLLER
ARCHITECTURE

PENSYARAH:
NORHANIZA AZREEN BT MOHAMED MOKHTAR
PIC MICROCONTROLLER ???
 PIC stands for Peripheral Interface Controller
 It is the brain child of Microchip
Technology,USA.
 A microcontroller is a compact microcomputer
designed to govern the operation of
embedded systems in motor vehicles, robots,
office machines, medical devices, mobile
radios, vending machines, home appliances,
and various other devices
A typical microcontroller includes a processor,
memory, and peripherals.
 One of the earlier versions of PIC Microcontrollers
is PIC16C6x/7x. The 7x family has an
enhancement of Analog to Digital converter
capability.
 These are available in 28 pin DIP, 40 pin DIP ,44
pin surface mount package…etc..some of PIC
controllers contain the letter A in their number.
The presence of A indicates the brown-out reset
feature, which causes a reset of the PIC when
the Power Supply voltage drops below 4.0v.
 The PIC 16F8XX Microcontrollers are basically
RISC microcontrollers with very small
instruction set of only 35 instructions and a
two-stage pipeline concept fetch and
execution of instructions.
 There are four devices in 16F8xx family,
PIC16F873, PIC16F874, PIC16F876 and
PIC16F877.
PIC 16 ARCHITECTURE’S BLOCK
DIAGRAM
PIC microcontroller’s CPU

 Arithmetic logic unit (ALU)- arithmetic


operations and for logical decisions.
 Memory unit (MU)- for storing the instructions
after processing.
 Control unit (CU)- used to control the
internal and external peripherals which are
connected to the CPU
 Accumulator - used for storing the results.
PIC 16F877
 PIC 16F877 is a 40-pin 8-Bit CMOS FLASH
Microcontroller .
 The core architecture is high- performance
RISC CPU . Since it follows the RISC
architecture, all single cycle instructions take
only one instruction cycle except for program
branches which take two cycles.
 16F877comes with 3 operating speeds with 4,
8, or 20 MHz clock input. Since each
instruction four operating clock cycles, each
instruction takes 0.2 μs when 20MHz oscillator
is used.
PIC 16F877
SALIENT FEATURES

 Speed :
When operated at its maximum clock rate a PIC executes most of its
instructions in 0.2 µs or five instructions per microsecond.

 Instruction set Simplicity :


The instruction set is so simple that it consists of only just 35 instructions

 Integration of operational features:


Power-on-reset (POR) and brown-out protection ensure that the chip
operates only when the supply voltage is within specifications. A watch
dog timer resets the PIC if the chip malfunctions or deviates from its
normal operation at any time.

 Programmable timer options:


Three timers can characterize inputs, control outputs and provide
internal timing for the program execution.
 Interrupt control:
Up to 12 independent interrupt sources can control
then the CPU deal with each sources.

 Powerful output pin control:


A single instruction can select and drive a single output pin
high or low in its 0.2µs instruction execution time. The PIC
can drive a load of up to 25µA.

 I/O port expansion:


With the help of built in serial peripheral interface the
number of I/O ports can be expanded. EPROM/DIP/ROM
options are provided.

 High performance RISC CPU


 Operating speed: DC – 20 MHz  10-bit multi-channel Analog-to-
clock input DC – 200 ns instruction Digital converter
cycle

 Selectable oscillator options


 Eight level deep hardware stack
 One USART /SCI port with 9-bit
address detection.
 Direct, indirect and relative
addressing modes
 Low-power, high-speed CMOS
EPROM/ROM technology
 Power-up Timer (PWRT) and
Oscillator Start-up Timer (OST)
 Fully static design
 Three Timers Timer0,Timer 1 and  Wide operating voltage range: 2.5V
Timer 2. to 6.0V

 Watchdog Timer (WDT) with its own  Commercial, Industrial and Extended
on-chip RC oscillator for reliable temperature ranges
operation
 Low-power consumption: <2mA
 Programmable code-protection @5V, 4MHz, 15µA typical @ 3V, 32
kHz, <1 Atypical standby current
 Power saving SLEEP mode
MEMORY ORGANIZATION:
 WREG register
- The PIC microcontroller has many other register
in addition to WREG register.
- They are called data memory space to
distinguish them from program ( code ) memory
space
- The data memory space in PIC is a read/write
(static RAM) memory
- In the PIC microcontroller literature, the data
memory is also called the file register.
 File register
- The file register is read/write memory used by
the CPU for data storage, scratch pad, and
registers for internal use and functions.
- The PIC micro-controllers file register size ranges
from 32 bytes to several thousand bytes
depending on the chip
- The file register data RAM in PIC is divided into
two sections:
1. Special Function Registers (SFR)
2. General-Purpose Registers (GPR) or
General Purpose RAM (GP RAM)
1.Special function register (SFRs)

- are dedicated to specific functions such as


ALU status, timers, serial communication, I/O
ports, ADC and so on.
- The function of each SFR is fixed by the CPU
designer at the time of design because it is
used for control of the micro-controller or
peripheral.
- The PIC SFRs are 8 bit registers. The number of
locations in the file register set aside for SFR
depends on the pin numbers and peripheral
functions supported by that chip.
2. The general purpose registers (GPR )
- are a group of RAM locations in the file register that
are used for data storage and scratch pad.
- Each location is 8 bits wide and can be used to
store any data we want as long as it is 8 bit.
- In the PIC micro-controllers, the space that is not
allocated to the special function registers is used for
general purpose registers.
- That means in a PIC chip with a thousand-byte file
register, no more than 100 bytes are used for
special function registers are the rest are used for
general purpose registers. A larger GPR size means
more difficulties in managing these registers if you
use assembly language programming.
 Status register

- The STATUS register is of most importance to


programming the PIC, it contains the arithmetic
status of the ALU (Arithmetic Logic Unit), the RESET
status and the bank select bit for data memory.
- If the STATUS register is the destination for an
instruction that affects the Z, DC or C bits, then the write
to these three bits is disabled.
- Furthermore, the TO and PD bits are not writable.

For example, CLRF STATUS will clear the upper-three bits


and set the Z bit. This leaves the STATUS register as 000u
u1uu (where u = unchanged).
bit 7:
bit 3:
IRP: Register Bank Select bit (used for indirect addressing) PD: Power-down bit
0 = Bank 0, 1 (00h - FFh) 1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
1 = Bank 2, 3 (100h - 1FFh)
The IRP bit is not used by the PIC16F8X. IRP should be maintained clear. bit 2:
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
bit 6-5: 0 = The result of an arithmetic or logic operation is not zero
RP1:RP0: Register Bank Select bits (used for direct addressing) bit (for ADDWF and ADDLW instructions) (For borrow the polarity is reversed)
00 = Bank 0 (00h - 7Fh)
bit 1:
01 = Bank 1 (80h - FFh) DC: Digit carry/borrow
10 = Bank 2 (100h - 17Fh) 1 = A carry-out from the 4th low order bit of the result occurred
11 = Bank 3 (180h - 1FFh) 0 = No carry-out from the 4th low order bit of the result
bit (for ADDWF and ADDLW instructions)
Each bank is 128 bytes. Only bit RP0 is used by the PIC16F8X. RP1 should be maintained clear.
bit 0:
C: Carry/borrow
bit 4:
1 = A carry-out from the most significant bit of the result occurred
TO: Time-out bit 0 = No carry-out from the most significant bit of the result occurred
1 = After power-up, CLRWDT instruction, or SLEEP instruction Note: For borrow the second operand the polarity is reversed. A subtraction is executed by
0 = A WDT time-out occurred adding the two’s complement of. For rotate (RRF, RLF) instructions, this bit is loaded with either
the high or low order bit of the source register
Understand!!!
IQ TEST
 How many pin for PIC 16F877?

 Type of File register ?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy