The PIC MCU
The PIC MCU
MICROCONTROLLERS
DEFINITION
Analogue comparators;
Internal oscillator;
Some even more complex devices in the family offer the following additional features:
USB interface;
Motor control
IDENTIFICATION OF A PIC
To identify a PIC, we can simply use its code.
PICXX-X-XX-XX
A 16F84-04 is Mid-Range PIC (16), with flash memory, of type 84 with 4MHz as maximum clock
frequency.
• A 16F877A is Mid-Range PIC (16), with flash memory, of type 877 with 20MHz as maximum clock
frequency.
• A 18F2550 is High-End PIC (18), with flash memory, of type 2550 with 20MHz as maximum clock
frequency.
• A 18F4620-12 is High-End PIC (18), with flash memory, of type 4620 with 12MHz as maximum
clock frequency.
THE PIC16F84A MICROCONTROLLER
Characteristics
Program memory (FLASH) - for storing a written program. The 16F84 offers a 1024 x 14 flash program
memory. That is 1 kilo words of 14 bits
PORTA and PORTB are physical connections between the microcontroller and the outside world. Port A has
five pins (RA0, RA1, RA2, RA3, RA4), and port B eight pins (RB0, RB1, RB2, RB3, RB4, RB5, RB6, RB7).
FREE-RUN TIMER- The timer can be used for measuring time which is very useful with some devices.
CENTRAL PROCESSING UNIT has a role of connective element between other blocks in the microcontroller.
It coordinates the work of other blocks and executes the user program.
INTERNAL ARCHITECTURE OF THE
16F84
PIN CONFIGURATION AND DESCRIPTION OF THE 16F84A
SETTING OF PINS
SOME OTHER PIC
MICROCONTROLLERS
U4
U5 U4 13
OSC1/CLKIN RB0/INT
33
9 21 14 34
16 17 OSC1/CLKIN RB0/INT OSC2/CLKOUT RB1
OSC1/CLKIN RA0 10 22 1
MCLR/Vpp/THV RB2
35
15 18 OSC2/CLKOUT RB1 36
OSC2/CLKOUT RA1 23 RB3/PGM
1 RB2 2 37
RA2 2 24 RA0/AN0 RB4
4 2 RA0/AN0 RB3/PGM 3 38
MCLR RA3 3 25 RA1/AN1 RB5
3 RA1/AN1 RB4 4
RA2/AN2/VREF- RB6/PGC
39
RA4/T0CKI 4 26 5 40
RA2/AN2/VREF-/CVREF RB5 RA3/AN3/VREF+ RB7/PGD
5 27 6
6 RA3/AN3/VREF+ RB6/PGC RA4/T0CKI
RB0/INT 6 28 7 15
7 RA4/T0CKI/C1OUT RB7/PGD RA5/AN4/SS RC0/T1OSO/T1CKI
RB1 7 16
8 RA5/AN4/SS/C2OUT RC1/T1OSI/CCP2
RB2 11 8 17
9 RC0/T1OSO/T1CKI RE0/AN5/RD RC2/CCP1
1 12 9 18
RB3 MCLR/Vpp/THV RC1/T1OSI/CCP2 RE1/AN6/WR RC3/SCK/SCL
10 13 10 23
RB4 RC2/CCP1 RE2/AN7/CS RC4/SDI/SDA
24
11 14 RC5/SDO
RB5 RC3/SCK/SCL 25
12 15 RC6/TX/CK
RB6 RC4/SDI/SDA 26
13 16 RC7/RX/DT
RB7 RC5/SDO
17
RC6/TX/CK 19
PIC16F84A 18 RD0/PSP0
RC7/RX/DT 20
RD1/PSP1
21
PIC16F876A RD2/PSP2
22
RD3/PSP3
27
RD4/PSP4
28
RD5/PSP5
29
RD6/PSP6
30
RD7/PSP7
PIC16F877