Professional Documents
Culture Documents
Microcontroller Systems
Chapters 5 & 6
Introduction to the
PIC Microcontroller
Benefits
Typically low-power/low-cost
Target for embedded applications
Easily programmable
Simple ISAs (RISC processors)
Use of development kits simplifies process
Limitations
Small storage space (registers, memory)
Restricted instruction set
May be required to multiplex pins
Not typically used for high performance
http://www.microchip.com
12/6/2020 Dr. Eng. Wajdi Halabi 12
PIC microcontrollers
history and features
A Brief History of PIC microcontroller.
They are all 8-bit processors that the CPU can work on
only 8 bits of data a time.
Problem: not all 100% upwardly compatible in terms of
software when going from one family to another family.
Ex.: 12xxx - 12-bit wide instructions
16xxx- 14-bit wide instructions
PIC18xxx - 16-bit wide with many new instructions
http://www.microchip.com
12/6/2020 Dr. Eng. Wajdi Halabi 13
PIC microcontrollers
history and features
Advantages of PIC:
Remarks:
RA0 - RA3: Pins on port A. No additional function
RA4 : TOCK1 which functions as a timer
RB0 : Interrupt input is an additional function.
RB1 - RB5: Pins on port B. No additional function.
RB6 : 'Clock' line in program mode.
RB7 : 'Data' line in program mode
MCLR : Reset input and Vpp programming voltage
Vss : Ground of power supply.
Vdd : Positive power supply pole.
OSC1 - OSC2 : Pins for connecting with oscillator.
PIC Clock
Generator
Reset
Power-on Reset (POR)
MCLR during normal operation
MCLR during SLEEP
WDT Reset (during
normal operation)
WDT Wake-up
(during SLEEP)
PORTS
Physical connection of CPU and outside world – monitor
OR control other components OR devices
A group of pins which can be accessed simultaneously OR
set the desired combination of zeros and ones
All port pins can be designated as input OR output
MEMORY ORGANIZATION
PIC16F84 has two separate memory blocks: data &
program
Data block: GPR and SFR registers in RAM memory
(read/write memory- static memory), EEPROM memory
Program block: FLASH memory
Memory Organization
of PIC16F84
Program Memory
Organization
Data Memory
Organization
Timer &
Prescalar
Flash Memory
Store permanent information on some palmsized computers
(operating system & core applications)
Unlike RAM (random-access memory), flash memory can
continue to store information in the absence of a power source.
Unlike ROM (read-only memory), we can write/update to flash
memory
More expensive than ROM
RAM
Random-access memory
The most common computer memory to perform necessary
tasks while the computer is on
An integrated circuit memory chip allows information to be
stored or accessed in any order and all storage locations are
equally accessible.
ROM
Read Only Memory
Non-volatile: hold programs and data that must be retained
even the computer is turned off
data cannot be easily written to ROM; depending on the
technology used in the ROM, writing may require special
hardware, or may be impossible.
A computer's BIOS may be stored in ROM.
EEPROM
Electrically Erasable Programmable Read Only Memory
ROM that can be erased electronically and reprogrammed in-
circuit (or with a device programmer).
EEPROM is very similar to flash memory. The biggest
difference is that the bytes (words) of an EEPROM can be
erased individually.