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

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.
No. 1990
1990 Rank
Rank

1991
1991 Rank
Rank

1992
1992 Rank
Rank

1993
1993 Rank
Rank

1994
1994 Rank
Rank

1995-96
1995-96 Rank
Rank 1997/8/9
1997/8/9 Rank
Rank

11
22
33
44
55
66
77
88
99
10
10
11
11
12
12
13
13
14
14
15
15
16
16
17
17
18
18
19
19
20
20

Motorola
Motorola
Mitsubishi
Mitsubishi
NEC
NEC
Intel
Intel
Hitachi
Hitachi
Philips
Philips
Matsushita
Matsushita
SGS-Thomson
SGS-Thomson
Siemens
Siemens
TI
TI
National
National
Toshiba
Toshiba
Sony
Sony
Sharp
Sharp
Oki
Oki
Zilog
Zilog
Microchip
Microchip
Matra
Matra MHS
MHS
Fujitsu
Fujitsu
Sanyo
Sanyo

Motorola
Motorola
Mitsubishi
Mitsubishi
Intel
Intel
NEC
NEC
Philips
Philips
Hitachi
Hitachi
Matsushita
Matsushita
SGS-Thomson
SGS-Thomson
National
National
TI
TI
Zilog
Zilog
Toshiba
Toshiba
Siemens
Siemens
Microchip
Microchip
Sharp
Sharp
Sanyo
Sanyo
Matra
Matra MHS
MHS
Sony
Sony
Oki
Oki
Fujitsu
Fujitsu

Motorola
Motorola
Mitsubishi
Mitsubishi
NEC
NEC
Hitachi
Hitachi
Philips
Philips
Intel
Intel
SGS-Thomson
SGS-Thomson
Microchip
Microchip
Matsushita
Matsushita
Toshiba
Toshiba
National
National
Zilog
Zilog
TI
TI
Siemens
Siemens
Sharp
Sharp
Oki
Oki
Sony
Sony
Sanyo
Sanyo
Fujitsu
Fujitsu
AMD
AMD

Motorola
Motorola
Mitsubishi
Mitsubishi
NEC
NEC
Philips
Philips
Intel
Intel
Microchip
Microchip
Zilog
Zilog
SGS-Thomson
SGS-Thomson
Matsushita
Matsushita
Hitachi
Hitachi
Toshiba
Toshiba
National
National
TI
TI
Ricoh
Ricoh
Fujitsu
Fujitsu
Siemens
Siemens
Sharp
Sharp
Oki
Oki
Sony
Sony
Temic
Temic

Motorola
Motorola
Mitsubishi
Mitsubishi
SGS-Thomson
SGS-Thomson
NEC
NEC
Microchip
Microchip
Philips
Philips
Zilog
Zilog
Hitachi
Hitachi
Fujitsu
Fujitsu
Intel
Intel
Siemens
Siemens
Toshiba
Toshiba
Matsushita
Matsushita
TI
TI
National
National
Temic
Temic
Sanyo
Sanyo
Ricoh
Ricoh
Oki
Oki
Sharp
Sharp

Motorola
Motorola
Mitsubishi
Mitsubishi
NEC
NEC
Intel
Intel
Hitachi
Hitachi
Philips
Philips
Matsushita
Matsushita
National
National
Siemens
Siemens
TI
TI
Sharp
Sharp
Oki
Oki
Toshiba
Toshiba
SGS-Thomson
SGS-Thomson
Zilog
Zilog
Matra
Matra MHS
MHS
Sony
Sony
Fujitsu
Fujitsu
AMD
AMD
Microchip
Microchip

Based on unit shipment volume, Source: Dataquest, July 2000

Motorola
Motorola
Microchip
Microchip
ST-Micro
ST-Micro
NEC
NEC
Mitsubishi
Mitsubishi
Philips
Philips
Siemens
Siemens
Toshiba
Toshiba
Hitachi
Hitachi
Zilog
Zilog
Fujitsu
Fujitsu
Atmel
Atmel
National
National
Sanyo
Sanyo
Matsushita
Matsushita
TI
TI
Sony
Sony
Intel
Intel
LG
LG Semicon
Semicon
Samsung
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*
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
9 Modular
Modular Cable
Cable

MPLAB
-ICD Header
MPLAB-ICD
Header

PIC16F877
PIC16F877

MPLAB
-ICD Module
MPLAB-ICD
Module
RS
-232
RS-232
Cable
Cable

+9V
+9V
Power
Power Supply
Supply
Cable
Cable
*From Microchip Seminar 2000

MPLAB
-ICD Demo
MPLAB-ICD
Demo Board
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
Host to
to Pod
Pod Cable
Cable

*Emulator
*Emulator Pod
Pod

*Processor
Processor
Module
Module

Flex
Flex Circuit
Circuit
Cable
Cable
*Device
*Device
Adapter
Adapter

*Each component
ordered separately
*From Microchip Seminar 2000

*SOIC
*SOIC
Transition
Transition
Socket
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


Features

MPLAB-ICE

ICEPIC

MPLAB-ICD

Real Time
Emulation
Communication

Full speed

Limited

Full Speed

Printer Port

Serial
Port

Serial Port

Code Coverage
Profiling
Programmable
Clock
Low voltage
Monitor Internal
Registers
Time Stamp
Complex Break and
Trigger
Requires Chip
Resources

Yes

None

None

Yes

No

No

Yes (2.0V)
Yes
(Except 16C5X)
Yes
Yes

No
No

Yes (3.0V)
No

No
No

No

No

No
No
(Single
Bkpt)
Yes

*From Microchip Seminar 2000

Development Systems
PICSTART Plus Development Programmer
RS
-232 Serial
RS-232
Serial
Interface
Interface
PICSTART Plus

DEVELOPMENT PROGRAMMER

POWER
ACTIVE

*From Microchip Seminar 2000

Low-cost Development

Programmer
Upgrades done in MPLAB
software. Firmware upgrades
occasionally required for new
Power
Power ON
ON
Programmer
Programmer PICmicro MCU sub-families
Uses serial programming
Active
Active
algorithms for all ICSP
capable devices
Also runs under Windows
NT!
40
-Pin ZIF Socket to accommodate
40-Pin
PICmicro
-pins. 68
-pin
PICmicro MCUs from 88-- to 40
40-pins.
68-pin
PLCC
PLCC can
can be
be programmed
programmed with
with an
an adapter
adapter

9V
9V DC
DC Input
Input

Microchip Technology Inc.


The Embedded Control Solutions Company
High Voltage
High Voltage
I/Os
I/Os

Precision
Precision
Voltage
Voltage
Reference
Reference

Amplifiers
Amplifiers

Filters
Filters

A/D
A/D

PICmicro
Microcontroller
AC Power
Battery

SRAM
SRAM

Serial NV
Serial NV
Memory
Memory

Power
Power
Management
Management
- Regulators
- Regulators
- Supervisory
- Supervisory

Interface
Interface
Products
Products

Digital
Digital
Peripherals
Peripherals

LCD
LCD
Drivers
Drivers

LED
LED
Drivers
Drivers