CHAPTER I
A PIC Microcontroller Framework
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 embedded
into some device for some purpose other than
to provide general purpose computing
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
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
Microcontroller VS. Microprocessor
3% (75Millions)
97%
(2.5 Billions)
Microcontroller
* John B. Peatman
Microprocessor
Microcontroller Unit Shipments
Worldwide 8-Bit Microcontroller
Market Share - Units
No. 1990 Rank
1991 Rank
1992 Rank
1993 Rank
1994 Rank
1995-96 Rank 1997/8/9 Rank
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Motorola
Mitsubishi
NEC
Intel
Hitachi
Philips
Matsushita
SGS-Thomson
Siemens
TI
National
Toshiba
Sony
Sharp
Oki
Zilog
Microchip
Matra MHS
Fujitsu
Sanyo
Motorola
Mitsubishi
Intel
NEC
Philips
Hitachi
Matsushita
SGS-Thomson
National
TI
Zilog
Toshiba
Siemens
Microchip
Sharp
Sanyo
Matra MHS
Sony
Oki
Fujitsu
Motorola
Mitsubishi
NEC
Hitachi
Philips
Intel
SGS-Thomson
Microchip
Matsushita
Toshiba
National
Zilog
TI
Siemens
Sharp
Oki
Sony
Sanyo
Fujitsu
AMD
Motorola
Mitsubishi
NEC
Philips
Intel
Microchip
Zilog
SGS-Thomson
Matsushita
Hitachi
Toshiba
National
TI
Ricoh
Fujitsu
Siemens
Sharp
Oki
Sony
Temic
Motorola
Mitsubishi
SGS-Thomson
NEC
Microchip
Philips
Zilog
Hitachi
Fujitsu
Intel
Siemens
Toshiba
Matsushita
TI
National
Temic
Sanyo
Ricoh
Oki
Sharp
Motorola
Mitsubishi
NEC
Intel
Hitachi
Philips
Matsushita
National
Siemens
TI
Sharp
Oki
Toshiba
SGS-Thomson
Zilog
Matra MHS
Sony
Fujitsu
AMD
Microchip
Based on unit shipment volume, Source: Dataquest, July 2000
Motorola
Microchip
ST-Micro
NEC
Mitsubishi
Philips
Siemens
Toshiba
Hitachi
Zilog
Fujitsu
Atmel
National
Sanyo
Matsushita
TI
Sony
Intel
LG Semicon
Samsung
Motorola 68HC11 & PIC
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
PIC - Typical Application
32kHZ
Serial
EEPROM
MSSP TIMER1
USART
A/D
MCU
PORTB
CCP
I/O
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
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
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
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
Memory Technology
FLASH Memory
 Standard product family
– Short lead times
 Programmed by designer
 In-Circuit Re-programmable
– Can be erased and reprogrammed
 In-Circuit Debugging capability
– Can be used on any package or die
 Most flexible solution
 Highest relative cost at same geometry
*From Microchip Seminar 2000
Memory Technology
OTP/EPROM Memory
 Parts available off the shelf
– Short lead times
 Lower cost than FLASH at same
geometry
 Programmed by designer
 In-Circuit Programmable
 More flexible than ROM
*From Microchip Seminar 2000
Memory Technology
ROM Memory
 Not off the shelf
– Designer must provide code
– Long lead times
 Programmed at the factory
 Least flexible solution
 Lowest cost solution
– Initial NRE (mask charge)
– Minimum quantities required
*From Microchip Seminar 2000
Memory Selection
 CHOOSE FLASH for debugging &
development of both products
– For Mass Distribution Product
• Use OTP in initial production
– Lower cost yet provides opportunity to change code
• Once code stabilizes convert to ROM
– Realize full cost savings
*From Microchip Seminar 2000
Memory Technology
ROM
EPROM
FLASH
PIC18CRXX*
PIC18C252
PIC18F252*
8Kw
PIC16CR76*
PIC18C242
PIC16C76
PIC18F242*
PIC16F876
4Kw
PIC16CR73*
PIC16CR63
PIC16C73
PIC16C63
PIC16F873
16Kw
2Kw
PIC16CR72
* Planned
*From Microchip Seminar 2000
PIC16C72
PIC16F870*
PIC16F872*
Development Tools
 Need to have complete tool solution
– Language Tools for code development
• Assemblers
• C-Compilers
–
–
–
–
Simulator
Emulator
Debugger
Programmer
 Need a tool that integrates them all together
*From Microchip Seminar 2000
PICmicro MCU Development Tools*
MPLAB®
Integrated Development Environment
Languages
MPASM
Assembler
Built-in
Editor
Source Level
Debugger
Simulators
Emulators
MPLAB-SIM
Simulator
MPLAB-ICE
2000
MPLINK
MPLIB
MPLAB-C17
MPLAB-C18
† Third Party Tool
*From Microchip Seminar 2000
Project
Manager
Programmers Third Party
PRO
MATE®II
MPLAB-ICD
ICEPIC†
PICSTART®
Plus
C Compilers†
Hi-Tech, IAR,
CCS
PICmicro MCU Development Tools
Language Products
 MPASM
– Microchip Universal Macro Assembler
– Supports all PICmicro MCUs
 MPLINK
– Create executable files from object files created by
MPASM or MPLAB-C17/C18
– May use libraries stored by MPLIB
 MPLIB
– Groups relocateable objects created by MPASM or
MPLAB-C17/C18
*From Microchip Seminar 2000
PICmicro MCU Development Tools
MPLAB-C17 & MPLAB-C18
 Microchip compiler for PIC17CXXX and
PIC18CXXX PICmicro MCUs
 ANSI compatible
 MPASM/MPLINK/MPLIB
– Compatible at object level
– Supports relocatable objects
 Reliable Code Generators
 Free 30 day copies available on the web
www.microchip.com
*From Microchip Seminar 2000
PICmicro MCU Development Tools
MPLAB-SIM
 Supports all PICmicro MCUs
 Discrete event simulator instruction based
 MPLAB compatible
– Unlimited breakpoints
– Unlimited trace points
– Examine/modify registers
– Watch variables
– Time stamp
– Stimulus injection
 Available electronically FREE
*From Microchip Seminar 2000
PICmicro MCU Development Tools
MPLAB-ICD In-Circuit Debugger
9” Modular Cable
MPLAB-ICD Header
PIC16F877
MPLAB-ICD Module
RS-232
Cable
+9V
Power Supply
Cable
*From Microchip Seminar 2000
MPLAB-ICD Demo Board
PICmicro MCU Development Tools
MPLAB-ICD Features
 Uses MPLAB IDE and PC serial port
 Real-time code execution, Variable Watching
 Single Step, One Hardware Breakpoint
 3.0V to 5.5V, 32kHz to 20MHz
 Small system impact using only 2 I/O pins
 Uses actual oscillator and other peripherals
 Every PIC16F87X is a debugger
*From Microchip Seminar 2000
PICmicro MCU Development Tools
MPLAB-ICE 2000
Host to Pod Cable
*Emulator Pod
*Processor
Module
Flex Circuit
Cable
*Device
Adapter
*Each component
ordered separately
*From Microchip Seminar 2000
*SOIC
Transition
Socket
PICmicro MCU Development Tools
MPLAB-ICE System Components
 Emulator pod (required)
• MPLAB-ICE 2000, full-featured system
 Processor module (required)
• PICmicro specific support (contains the flex circuit cable)
 Device adapter (required)
• PICmicro and package specific support (DIP, PLCC, and
PQFP/TQFP)
 Transition socket (optional depending on package)
• Required for SOIC, SSOP, PQFP, & TQFP
• Transitions pin-out from Device Adapter to
specific surface mount package
*From Microchip Seminar 2000
Emulator/Debugger Comparison Chart
F e a tu re s
M P L A B -IC E
IC E P IC
M P L A B -IC D
R e a l T im e
E m u la tio n
C o m m u n ic a tio n
F u ll s p e e d
L im ite d
F u ll S p e e d
P rin te r P o rt
S e ria l
P o rt
S e ria l P o rt
C o d e C o ve ra g e
P ro filin g
P ro g ra m m a b le
C lo c k
L o w vo lta g e
M o n ito r In te rn a l
R e g is te rs
T im e S ta m p
C o m p le x B re a k a n d
T rig g e r
R e q u ire s C h ip
R e s o u rc e s
Yes
None
None
Yes
No
No
Y e s (2 .0 V )
Yes
(E x c e p t 1 6 C 5 X )
Yes
Yes
No
No
Y e s (3 .0 V )
No
No
No
No
No
No
No
(S in g le
B k p t)
Yes
*From Microchip Seminar 2000
Development Systems
PICSTART Plus Development Programmer
RS-232 Serial
Interface
PICSTART
 Low-cost Development
Programmer
 Upgrades done in MPLAB
software. Firmware upgrades
occasionally required for new
Power ON
Programmer PICmicro MCU sub-families
 Uses serial programming
Active
algorithms for all ICSP
capable devices
 Also runs under Windows
NT!
40-Pin ZIF Socket to accommodate
PICmicro MCUs from 8- to 40-pins. 68-pin
PLCC can be programmed with an adapter
9V DC Input
Plus
DEVELOPMENT PROGRAMMER
POWER
ACTIVE
*From Microchip Seminar 2000
Microchip Technology Inc.
The Embedded Control Solutions Company®
High Voltage
I/O’s
Precision
Voltage
Reference
Amplifiers
Filters
A/D
PICmicro
Microcontroller
AC Power
Battery
SRAM
Serial NV
Memory
Power
Management
- Regulators
- Supervisory
LCD
Drivers
Interface
Products
Digital
Peripherals
LED
Drivers
Descargar

No Slide Title