PIC16f877A Microcontrollers and Embedded Systems
PIC16f877A Microcontrollers and Embedded Systems
(MES)
Lecture #3
PIC Microcontrollers
2019-2020
Agenda
What’s a Microcontroller?
Types of Microcontrollers
1-Microprocessor
2-RAM / 3-Flash memory (program memory )/4-EEPROM
5-Interfaces : power supply ,Ethernet, Lcd, Serial ports ,ADC , Timers,
I/O ports
CISC/RISC
RD 0-7 (8)
RE 0-2 (3)
Timers 3
Instruction Set 35 Instructions
Pins (DIP) 40 Pins
Introduction to 16f877A :
PIC Microcontroller product family..
• The F in a name generally indicates the PICmicro uses flash
memory and can be erased electronically.
• The C generally means it can only be erased by exposing the die
to ultraviolet light (which is only possible if a windowed package
style is used). An exception to this rule is the PIC16C84 which
uses EEPROM and is therefore electrically erasable.
Same family differences :
Different families:
Microcontroller Packaging and
Appearance
Pin 11 is Vdd so
it is connected
to 5 volt
Pin 11 is Vss so
it is connected
to 0 volt
(grounded)
Pins 31,32 :
Pin 32 is Vdd so
it is connected
to 5 volt
Pin 31 is Vss so
it is connected
to 0 volt
(grounded)
Pins 13,14 :
Oscillator crystal ports
Ports:
Analog-to-Digital Module
1. I/O Ports:
• PIC16F877 has 5 I/O ports:
• PORT A has 6 bit wide, Bidirectional
• PORT B, C, D have 8 bit wide, Bidirectional
• PORT E has 3 bit wide, Bidirectional
• In addition, they have the following alternate
functions:
PIC16F877 Peripheral features
3. Timer/counter modules
• Generate interrupts on timer overflow
• Can use external pins as clock in/ clock out (ie. for counting
events)
• There are 3 Timer/counter modules:
• Timer0: 8-bit timer/counter with 8-bit pre-scaler
• Timer1: 16-bit timer/counter with 8-bit pre-scaler, can be
incremented during SLEEP via external crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period register, pre-scaler and
post-scaler.
PIC16F877 Peripheral features