8/10/2019 PIC Part1 (Pic-chap1
1/33
8/10/2019 PIC Part1 (Pic-chap1
2/33
CHAPTER I
A PIC Microcontroller Framework
8/10/2019 PIC Part1 (Pic-chap1
3/33
Introduction
Microcomputer?
A computer in which the processing unit is a
microprocessor
Usually - a general purpose computer (or PC)
Embedded Controller
is a controller (or computer) that is embeddedinto some device for some purpose other than
to provide general purpose computing
8/10/2019 PIC Part1 (Pic-chap1
4/33
Introduction
Microcontroller?
The microcontroller could be called a "one-chip
solution". It typically includes:
CPU (central processing unit) RAM (Random Access Memory)
EPROM/PROM/ROM (Erasable Programmable
Read Only Memory) I/O (input/output) - serial and parallel
timers
interrupt controller
8/10/2019 PIC Part1 (Pic-chap1
5/33
Five Broad Markets Consumer segment
Home appliances, Entertainment equipment
Automotive
Keyless entry, Anti-lock braking, Airbag, etc.
Office Automation
PC, Keyboards, copiers, printers
Telecommunications Cellular phones, pagers, answering machine
Industrial Products Door locks, automatic faucets, industrial machine
8/10/2019 PIC Part1 (Pic-chap1
6/33
Microcontroller VS. Microprocessor
* John B. Peatman
97%3%
Microcontroller Microprocessor
(2.5 Billions)
(75Millions)
8/10/2019 PIC Part1 (Pic-chap1
7/33
Microcontroller Unit Shipments
8/10/2019 PIC Part1 (Pic-chap1
8/33
No. 1990 Rank 1991 Rank 1992 Rank 1993 Rank 1994 Rank 1995-96 Rank 1997/8/9 Rank
1 Motorola Motorola Motorola Motorola Motorola Motorola Motorola
2 Mitsubishi Mitsubishi Mitsubishi Mitsubishi Mitsubishi Mitsubishi Microchip
3 NEC NEC Intel NEC NEC SGS-Thomson ST-Micro
4 Intel Intel NEC Hitachi Philips NEC NEC
5 Hitachi Hitachi Philips Philips Intel Microchip Mitsubishi
6 Philips Philips Hitachi Intel Microchip Philips Philips
7 Matsushita Matsushita Matsushita SGS-Thomson Zilog Zilog Siemens
8 National SGS-Thomson SGS-Thomson Microchip SGS-Thomson Hitachi Toshiba9 Siemens Siemens National Matsushita Matsushita Fujitsu Hitachi
10 TI TI TI Toshiba Hitachi Intel Zilog
11 Sharp National Zilog National Toshiba Siemens Fujitsu
12 Oki Toshiba Toshiba Zilog National Toshiba Atmel
13 Toshiba Sony Siemens TI TI Matsushita National
14 SGS-Thomson Sharp Microchip Siemens Ricoh TI Sanyo15 Zilog Oki Sharp Sharp Fujitsu National Matsushita
16 Matra MHS Zilog Sanyo Oki Siemens Temic TI
17 Sony Microchip Matra MHS Sony Sharp Sanyo Sony
18 Fujitsu Matra MHS Sony Sanyo Oki Ricoh Intel
19 AMD Fujitsu Oki Fujitsu Sony Oki LG Semicon
20 Microchip Sanyo Fujitsu AMD Temic Sharp Samsung
No. 1990 Rank 1991 Rank 1992 Rank 1993 Rank 1994 Rank 1995-96 Rank 1997/8/9 Rank
1 Motorola Motorola Motorola Motorola Motorola Motorola Motorola
2 Mitsubishi Mitsubishi Mitsubishi Mitsubishi Mitsubishi Mitsubishi Microchip
3 NEC NEC Intel NEC NEC SGS-Thomson ST-Micro
4 Intel Intel NEC Hitachi Philips NEC NEC
5 Hitachi Hitachi Philips Philips Intel Microchip Mitsubishi
6 Philips Philips Hitachi Intel Microchip Philips Philips
7 Matsushita Matsushita Matsushita SGS-Thomson Zilog Zilog Siemens
8 National SGS-Thomson SGS-Thomson Microchip SGS-Thomson Hitachi Toshiba
9 Siemens Siemens National Matsushita Matsushita Fujitsu Hitachi
10 TI TI TI Toshiba Hitachi Intel Zilog
11 Sharp National Zilog National Toshiba Siemens Fujitsu
12 Oki Toshiba Toshiba Zilog National Toshiba Atmel
13 Toshiba Sony Siemens TI TI Matsushita National
14 SGS-Thomson Sharp Microchip Siemens Ricoh TI Sanyo15 Zilog Oki Sharp Sharp Fujitsu National Matsushita
16 Matra MHS Zilog Sanyo Oki Siemens Temic TI
17 Sony Microchip Matra MHS Sony Sharp Sanyo Sony
18 Fujitsu Matra MHS Sony Sanyo Oki Ricoh Intel
19 AMD Fujitsu Oki Fujitsu Sony Oki LG Semicon
20 Microchip Sanyo Fujitsu AMD Temic Sharp Samsung
Based on unit shipment volume, Source: Dataquest, July 2000
Worldwide 8Worldwide 8--BitBit MicrocontrollerMicrocontroller
Market ShareMarket Share -- UnitsUnits
8/10/2019 PIC Part1 (Pic-chap1
9/33
Motorola 68HC11 & PIC
8/10/2019 PIC Part1 (Pic-chap1
10/33
Peripheral Interface Controller (PIC)
PIC Microcontroller Manufactured by Microchip Technology
8-bit RISC microcontroller
Embedded (hidden or buried) intelligence Available with a range of capabilities, 12-16 bit
instruction, 8-44 pin part
Packaged in both DIP and surface-mount packages Low cost
8/10/2019 PIC Part1 (Pic-chap1
11/33
PIC - Typical Application
A/DA/D
CCPCCP
I/OI/O
PO
RTB
PO
RTB
U
SART
U
SART
MSSPMSSP TIMER1TIMER1
MCUMCU
SerialSerial
EEPROMEEPROM
32kHZ32kHZ
8/10/2019 PIC Part1 (Pic-chap1
12/33
PIC WIDE POPULARITY Fast
Performance 8-bit, microcontroller Executes most of the instructions in 0.2us or five instructions per
second (20MHz clock)
Smart
Set of development tools
Quick Time to develop/market (Flash/OTP)
Cool Low power consumption
Smooth
Upward migration
8/10/2019 PIC Part1 (Pic-chap1
13/33
8/10/2019 PIC Part1 (Pic-chap1
14/33
PIC WIDE POPULARITY (Cont.)
Instruction set
Small - 35 instructions
Integration of operational features
Power-on reset and brown-out protection
Watchdog timer
Support four clock options
RC
X-TAL/Ceramic resonator High-speed OSC
Low Power
8/10/2019 PIC Part1 (Pic-chap1
15/33
PIC WIDE POPULARITY (Cont.)
Programmable timer Options
Interrupt control
Up to 12 independent interrupt source
Powerful output pin control Drive a load of up to 25 mA
I/O port expansion
Built-in serial peripheral interface can make use of
standard shift-register to add number of I/O pins
8/10/2019 PIC Part1 (Pic-chap1
16/33
PIC WIDE POPULARITY (Cont.)
Serial Programming via two pins
Low cost programmer
Flash/EPROM/OTP/ROM options
Free (http://www.microchip.com) MPLAB
Assembler and Simulator
Manuals
Application notes
8/10/2019 PIC Part1 (Pic-chap1
17/33
Memory Technology
FLASH Memory
Standard product familyStandard product family
Short lead times
Programmed by designerProgrammed by designer
InIn--Circuit ReCircuit Re--programmableprogrammable
Can be erased and reprogrammed
InIn--Circuit Debugging capabilityCircuit Debugging capability
Can be used on any package or dieMost flexible solutionMost flexible solution
Highest relative cost at same geometryHighest relative cost at same geometry
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
18/33
Memory Technology
OTP/EPROM Memory
Parts available off the shelfParts available off the shelf
Short lead timesShort lead times
Lower cost than FLASH at sameLower cost than FLASH at same
geometrygeometry
Programmed by designerProgrammed by designer
InIn--Circuit ProgrammableCircuit Programmable
More flexible than ROMMore flexible than ROM
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
19/33
Memory Technology
ROM Memory
Not off the shelfNot off the shelf
Designer must provide codeDesigner must provide code
Long lead timesLong lead times
Programmed at the factoryProgrammed at the factoryLeast flexible solutionLeast flexible solution
Lowest cost solutionLowest cost solution Initial NRE (mask charge)Initial NRE (mask charge)
Minimum quantities requiredMinimum quantities required
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
20/33
Memory SelectionMemory Selection
CHOOSE FLASHCHOOSE FLASH for debugging &for debugging &
development of both productsdevelopment of both products
ForFor Mass Distribution ProductMass Distribution Product
UseUse OTPOTP in initial productionin initial production Lower cost yet provides opportunity to change codeLower cost yet provides opportunity to change code
Once code stabilizes convert toOnce code stabilizes convert to ROMROM
Realize full cost savingsRealize full cost savings
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
21/33
Memory Technology
PIC16F870*PIC16F870*
* Planned
ROMROM EPROMEPROM FLASHFLASH
PIC16CR76*PIC16CR76*
PIC16CR73*PIC16CR73*
PIC16CR63PIC16CR63
PIC16CR72PIC16CR72
PIC18C242PIC18C242
PIC16C76PIC16C76
PIC16C73PIC16C73
PIC16C63PIC16C63
PIC16C72PIC16C72
PIC18F242*PIC18F242*
PIC16F876PIC16F876
PIC16F873PIC16F873
PIC16F872*PIC16F872*2Kw2Kw
4Kw4Kw
8Kw8Kw
PIC18CRXXPIC18CRXX* PIC18C252PIC18C252 PIC18F252*PIC18F252*16Kw16Kw
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
22/33
Development Tools Need to have complete tool solutionNeed to have complete tool solution
Language Tools for code developmentLanguage Tools for code development
AssemblersAssemblers
CC--CompilersCompilers
SimulatorSimulator EmulatorEmulator
DebuggerDebugger
ProgrammerProgrammer
Need a tool that integrates them all togetherNeed a tool that integrates them all together
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
23/33
PICmicro MCU Development Tools*
MPLAB-ICD
Project
Manager
Built-in
Editor
Source Level
Debugger
MPASMAssembler
Languages Programmers
MPLAB-SIMSimulator
Simulators Emulators Third Party
MPLINK
MPLIB
MPLAB
Integrated Development Environment
PICSTART
Plus
PRO MATEII
ICEPIC
Third Party Tool
MPLAB-ICE2000
C Compi lers
Hi-Tech, IAR,
CCS
MPLAB-C17
MPLAB-C18
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
24/33
PICmicro MCU Development Tools
Language Products
MPASMMPASM
Microchip Universal Macro AssemblerMicrochip Universal Macro Assembler Supports allSupports all PICmicro MCUsPICmicro MCUs
MPLINKMPLINK
Create executable files from object files created byCreate executable files from object files created byMPASM or MPLABMPASM or MPLAB--C17/C18C17/C18
May use libraries stored by MPLIBMay use libraries stored by MPLIB
MPLIBMPLIB GroupsGroups relocateablerelocateable objects created by MPASM orobjects created by MPASM or
MPLABMPLAB--C17/C18C17/C18
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
25/33
PICmicro MCU Development Tools
MPLAB-C17 & MPLAB-C18
Microchip compiler for PIC17CXXX andMicrochip compiler for PIC17CXXX and
PIC18CXXXPIC18CXXX PICmicro MCUsPICmicro MCUs
ANSI compatibleANSI compatible
MPASM/MPLINK/MPLIBMPASM/MPLINK/MPLIB Compatible at object levelCompatible at object level
SupportsSupports relocatablerelocatable objectsobjects
Reliable Code GeneratorsReliable Code Generators
Free 30 day copies available on the webFree 30 day copies available on the web
www.microchip.comwww.microchip.com
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
26/33
PICmicro MCU Development Tools
MPLAB-SIM
Supports allSupports all PICmicro MCUsPICmicro MCUs
Discrete event simulator instruction basedDiscrete event simulator instruction based
MPLAB compatibleMPLAB compatible Unlimited breakpointsUnlimited breakpoints
Unlimited trace pointsUnlimited trace points
Examine/modify registersExamine/modify registers
Watch variablesWatch variables
Time stampTime stamp Stimulus injectionStimulus injection
Available electronicallyAvailable electronically FREEFREE
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
27/33
PICmicro MCU Development Tools
MPLAB-ICD In-Circuit Debugger
+9V
Power Supply
Cable
+9V+9V
Power SupplyPower Supply
CableCable
MPLAB-ICD ModuleMPLABMPLAB--ICD ModuleICD Module
MPLAB-ICD HeaderMPLABMPLAB--ICD HeaderICD Header
MPLAB-ICD Demo BoardMPLABMPLAB--ICD Demo BoardICD Demo Board
PIC16F877PIC16F877PIC16F8779 Modular Cable9 Modular Cable9 Modular Cable
RS-232
Cable
RSRS--232232
CableCable
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
28/33
PICmicro MCU Development Tools
MPLAB-ICD Features Uses MPLAB IDE and PC serial portUses MPLAB IDE and PC serial port
RealReal--time code execution, Variable Watchingtime code execution, Variable Watching
Single Step, One Hardware BreakpointSingle Step, One Hardware Breakpoint
3.0V to 5.5V, 32kHz to 20MHz3.0V to 5.5V, 32kHz to 20MHz Small system impact using only 2 I/O pinsSmall system impact using only 2 I/O pins
Uses actual oscillator and other peripheralsUses actual oscillator and other peripherals
Every PIC16F87X is a debuggerEvery PIC16F87X is a debugger
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
29/33
PICmicro MCU Development Tools
MPLAB-ICE 2000Host to Pod CableHost to Pod CableHost to Pod Cable
*Emulator Pod*Emulator Pod*Emulator Pod
*ProcessorModule
**ProcessorProcessorModuleModule
Flex CircuitCableFlex CircuitFlex CircuitCableCable
*DeviceAdapter*Device*DeviceAdapterAdapter
*SOICTransitionSocket
*SOIC*SOICTransitionTransitionSocketSocket*Each component
ordered separately
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
30/33
PICmicro MCU Development Tools
MPLAB-ICE System Components
Emulator podEmulator pod (required)(required) MPLABMPLAB--ICE 2000, fullICE 2000, full--featured systemfeatured system
Processor moduleProcessor module (required)(required) PICmicroPICmicro specific support (contains the flex circuit cable)specific support (contains the flex circuit cable)
Device adapterDevice adapter (required)(required) PICmicroPICmicro and package specific support (DIP, PLCC, andand package specific support (DIP, PLCC, and
PQFP/TQFP)PQFP/TQFP)
Transition socketTransition socket (optional depending on package)(optional depending on package) Required for SOIC, SSOP, PQFP, & TQFPRequired for SOIC, SSOP, PQFP, & TQFP
Transitions pinTransitions pin--out from Device Adapter toout from Device Adapter to
specific surface mount packagespecific surface mount package
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
31/33
8/10/2019 PIC Part1 (Pic-chap1
32/33
Development Systems
PICSTART Plus Development Programmer
Low-cost Development
Programmer
Upgrades done in MPLAB
software. Firmware upgrades
occasionally required for new
PICmicro MCU sub-families
Uses serial programming
algorithms for all ICSP
capable devices
Also runs under WindowsNT!
ProgrammerActiveProgrammerProgrammer
ActiveActive
40-Pin ZIF Socket to accommodate
PICmicro MCUs from 8- to 40-pins. 68-pin
PLCC can be programmed with an adapter
4040--Pin ZIF Socket to accommodatePin ZIF Socket to accommodate
PICmicro MCUsPICmicro MCUs from 8from 8-- to 40to 40--pins. 68pins. 68--pinpin
PLCC can be programmed with an adapterPLCC can be programmed with an adapter
PICSTARTPICSTART PlusPlusDEVELOPMENT PROGRAMMERDEVELOPMENT PROGRAMMER
POWERPOWER
ACTIVEACTIVE
RS-232 Serial
Interface
RSRS--232 Serial232 Serial
InterfaceInterface
9V DC Input9V DC Input9V DC Input
Power ONPower ONPower ON
*From Microchip Seminar 2000
8/10/2019 PIC Part1 (Pic-chap1
33/33
Microchip Technology Inc.The Embedded Control Solutions Company
Digital
Peripherals
DigitalDigital
PeripheralsPeripherals LED
Drivers
LEDLED
DriversDrivers
LCD
Drivers
LCDLCD
DriversDrivers
Ampl if iersAmpl if iersAmpl if iers
FiltersFiltersFilters
SRAMSRAMSRAM
A/DA/DA/D
Precision
Voltage
Reference
PrecisionPrecision
VoltageVoltage
ReferenceReference
Interface
Products
InterfaceInterface
ProductsProducts
Power
Management
- Regulators
- Supervisory
PowerPowerManagementManagement
-- RegulatorsRegulators
-- SupervisorySupervisory
AC PowerAC Power
BatteryBattery
High Voltage
I/Os
High VoltageHigh Voltage
I/OsI/Os
Serial NV
Memory
Serial NVSerial NV
MemoryMemory
PICmicroPICmicroMicrocontrollerMicrocontroller