Você está na página 1de 37

Microprocessor & Microcontroller Based Systems

Lecture 1: Introduction to Microcontrollers

By: Shahid S. Jan (Modified by Faizan Jawaid)

Course Online
Course web site:
Dropbox link
Syllabus, lecture slides, assignments, solutions, project guidelines, reference/reading material etc.

CLASS POLICY
Assignments must be submitted within the

Microcontroller
Elements of a microcontroller
Microprocessor I/O ports Memory Counters and timers Special purpose interface devices (RS232, USB, CAN, PWM, ADC, etc.)
4

Microcontroller

Embedded Systems
Embedded systems are special purpose computing systems designed to perform specific task(s).

Embedded Systems

Intentionally left blank.

Embedded Systems Markets


1. 2. 3. 4. 5. 6. Household Entertainment Automotive Industry Communication Medical
8

1. Household
Climate control (thermostats, furnaces, etc.) Sprinkler systems Home security systems Appliances
Microwaves, refrigerators, ovens, washing machines, dish washers, etc.

RFID
9

2. Entertainment
TV, DVD/BR players, Remote Controllers, etc. Game consoles (Xbox, PS, Nintendo) iPod Digital cameras

10

3. Automotive
50100 embedded systems in autos 1015 million lines of C code 3545 micros per automobile BMW has a max of 70 micros
11

3. Automotive (contd.)
Antilock brakes Air bags Keyless entry Fuel injection Climate control GPS
12

4. Industrial
ATM Machines Computer equipment (networks, printers, mouse devices, disk drives, etc.) Calculators Avionics

13

4. Industrial (contd.)
Test equipment (scopes, meters, etc.) Robotics Ultrasound M/c Electronic tolls

14

5. Communications
Cell phones Answering machines, fax machines PDAs Wireless radio RFID

15

6. Medical Applications
Dialysis Electronic Surgical equipment Monitoring (ECG, EEG, blood pressure, ...) Imaging (Ultrasound, MRI, X-Ray)
16

Embedded Systems Market


Worldwide PC sales in 2008: 256 million units
Worldwide microcontroller sales in 2008: 11 billion units

17

Embedded Systems Growth


MPU 2004 2005 2006 2007 2008 2009 MCU DSP Total 50,734 54,687 59,526 MPU = microprocessors MCU = microcontrollers DSP = digital signal processors World market, millions of dollars CAGR = compounded annual growth rate 30,488 12,449 7,798 34,970 12,082 7,635 37,605 12,837 9,083

44,141 13,981 11,046 69,168 45,280 14,686 11,391 71,358 52,020 16,399 13,205 81,624

2010
2011

56,154 17,805 15,996 89,956


61,331 18,864 17,664 97,859 8% 14% 10%

CAGR 10%

Source: DSP Outperforms.pdf


18

Embedded Systems Growth


Sales 2004 2005 2006 2007 2008 2009 12,449 12,082 12,446 13,716 15,631 16,272 Units
6,930 7,081 8,464 10,233 11,255 11,831

Price/unit
$1.80 $1.71 $1.47

$1.34

$1.39
$1.38

Microcontrollers only Sales in millions of dollars Units in millions


Source: Market1.doc, http://www.electronics.ca/presscente r/articles/580/1/New-Study-Predicts10-percent-Growth-forMicrocontrollers/Page1.html

2010
2011 2012

17,723
19,204 20,480

13,502
14,450 15,765

$1.31
$1.33 $1.30 1%

2007-12 8% CAGR

9%

19

Automotive Applications
Microcontrollers in automobiles
$5.8 billion in 2006 $9.5 billion in 2010

20

DSPs
Two largest DSP customers: Nokia and Motorola Wireless phones comprise 85% of DSP market

21

DSP Market

22

Microcontroller Market
2005: 8-bit market about $5 billion, led by Microchip Inc. (24%) 16-bit market about $5 billion Over 40 microcontroller manufacturers
TI, Motorola, Freescale, Atmel, Parallax, National, Intel, Zilog, Hitachi/Mitsubishi/Renesas, Cypress, Holtek, Rabbit, Toshiba, NEC, Philips, Sanyo, Matsushita, Sony, LG Semicon, Samsung, Siemens, Toshiba, Fujitsu, Semtech,
23

Microchip PIC
Microchip makes almost 400 different microcontrollers Microchip Advanced Parts Selector software available at www.microchip.com

24

PIC 16F877
Datasheet p. 1 PIC = peripheral interface controller Max clock freq. 4 MHz 10 MHz 20 MHz 1 instr. every 4 or 8 clock cycles
25

Memory Types
ROM PROM EPROM (OTP) EEPROM (Flash) RAM

26

PIC Programming
EEPROM Programmer interfaces with Microchip software

27

EPROM Eraser

28

In Circuit Debugger: Olimex ICD 1


RS232 interface Power supply required

Available from Sparkfun


29

In-Circuit Debugger: PICkit 2


USB interface Power supply is not required

Mirochip Inc.

30

Lab Setup
USB or RS232 6-pin cable header

MPLAB

ICD
PIC

PC
power supply (ICD1 only)

Breadboard
power supply
31

Microchip PIC Features


High performance RISC CPU Only 35 single word instructions to learn 8K 14-bit words of FLASH Program Memory 368 bytes of general purpose data memory (RAM) 256 bytes of EEPROM Data Memory Interrupt capability (14 sources) Eight level deep hardware stack Watchdog timer ( will be discussed in lectures ) Programmable code protection Power saving SLEEP mode
32

Program Memory
8K words, 14 bits each 8K = 8 1024 = 8192 = 0x2000 Addresses 0x00000x1FFF Addresses are 13 bits

33

Datasheet p. 136 35 instructions 1 or 2 instr. cycles 14 bits/instruction Example: goto 0x3A2 = 10 1011 1010 0010 = 0x2BA2 Assembly code Assembler Machine code

34

Datasheet p. 13 8-bit data words 368 bytes of data RAM, which is fast but volatile 256 bytes of data EEPROM, which is slow but nonvolatile (not shown on this page)

GPRs: 96+80+96+96 = 368 bytes


35

Harvard Architecture
Instruction 14 bits Data 8 bits

Program Memory

Address 13 bits

CPU

Address 9 bits

Data Memory

PIC16F877 bus widths


36

The End

Você também pode gostar