Вы находитесь на странице: 1из 15

Introduction to PIC 16F8XX

By Zulfakar Aspar,
Microelectronic and Computer Engineering, Faculty of Electrical Engineering, Universiti Teknologi Malaysia

Why Use a Microcontroller?

eg. Pentium, AMD Athlon, Ultra Spark t S k etc

Eg Microchip PIC, Atmel AVR, Motorolla i M t ll series

Very powerfull and resources hungry gy Core CPU only Expensive Complex board design

Just enough processing p power and resources All necessary peripherals are integrated Cheap Very simple board design

Why Use a PIC Microcontroller?

The highest microcontroller volume p production replacing Motorolla p g microcontroller Has a variety of memory built in built-in Has a variety of configuration Ch Cheapest compared to others (US$0 55 to d h (US$0.55 US$10.90 per unit)

Mid-Range Device Selection

PIC is a 8 bit microcontroller with three main categories: 1. Baseline
a) 12 bit instruction (opcode) word length b) PIC 10F/12C/12F


Mid Range Mid-Range

a) 14 bit instruction (opcode) word length b) PIC 16C/16F

3. 3

High-End i h d
a) 16 bit instruction (opcode) word length b) PIC 17C/18C/18F )

PIC Architecture
8 bit datapath RISC instruction set Havard memory 4 stage pipeline i li

PIC16F873/4/6/7 Block Diagram/Architecture

Memory (PM & DM)

Control Unit (CU)

Arithmetic and Logic Unit (ALU) Peripherals (Timer, ADC, Comparator, C t USART etc)

Input/ Output (I/O)

PIC16F873/4/6/7 Architecture

Device Selection
PIC can be choose based on: 1. Program Memory
a) Type: ROM, OTP, Flash b) Size: (min. 512 words, max. 65536 words)

2. 2 Data Memory
a) RAM b) EEPROM )

3. Pins
a) I/O b) Package

Device Selection (cont)

PIC can be choose based on: 4. Analog I/O
a) ADC: 8 bit and 10 bit b) Comparators


Digital I/O
a) PWM: 10 bit b) Timers/WDT: 8 bit, 16 bit, prescalar c) S i l I/O: I2C SPI USART etc. ) Serial I/O I2C, SPI, USART, t


a) Internal ) b) External

Device Selection (cont)

PIC can be choose based on: 7. Accessories
a) b) c) ) d) ICSP BOR/PBOR PLVD CCP/ECCP Current sink C t i k Vref Power management Etc.


a) ) b) c) d)

Example of Device Selection

Scenario 1: g y 1. Small reProgramable memory 2. No ADC 3. 11 I/O Choose PIC16F84A

Example of Device Selection

Scenario 2: 1. Medium size reProgramable memory 2. 2 unit ADC 3. 20 I/O Choose PIC16F876

Example of Device Selection

Scenario 3: 1. Big size reProgramable memory during development but it will be downsizeable d l tb t ill b d i bl during production 2. 2 2 unit ADC 3. 20 I/O Choose PIC18F252 during development but use PIC16F876 during production

What do We need to Learn PIC?

Assembler need assembly language p g programming skills g Device Programmer A PC Some hardware: donut board, components, wires etc. Several simple application ideas

Other Additional Tools

Basic or C language compiler as a better alternative Simulator Emulator Logic probe