Fudametals of Chapter 1 Microprocessor ad Microcotroller Dr. Farid Farahmad Updated: Tuesday, Jauary 16, 2018
Evolutio First came trasistors Itegrated circuits SSI (Small-Scale Itegratio) to ULSI Very Large Scale Itegratio circuits (VLSI) 1- Microprocessors (MPU) Microcomputers (with CPU beig a microprocessor) Compoets: Memory, CPU, Peripherals (I/O) Example: Persoal computers 2- Microcotroller (MCU) Microcomputers (with CPU beig a microprocessor) May special fuctio peripheral are itegrated o a sigle circuit Types: Geeral Purpose or Embedded System (with special fuctioalities)
Microcotrollers Embedded Systems A embedded system is a special-purpose computer system desiged to perform oe or a few dedicated fuctios ofte with real-time A itegrated device which cosists of multiple devices Microprocessor (MPU) Memory I/O (Iput/Output) ports Ofte has its ow dedicated software
Embedded Systems 4
Amazo Warehouse Kiva Robot 5
Microprocessor-Based Systems Cetral Processig Uit (CPU) Memory Iput/Output (I/O) circuitry Buses Address bus Data bus Cotrol bus
MPU CLK GP- CPU Reg CPU Arithmetic Logic Uit Register Arrays Microprocessor-based System Cotrol Uit
Microprocessor-Based System with Buses: Address, Data, ad Cotrol
Microprocessor-based Systems Microprocessor The microprocessor (MPU) is a computig ad logic device that executes biary istructios i a sequece stored i memory. Characteristics: Geeral purpose cetral processor uit (CPU) Biary Register-based Clock-drive Programmable
Microprocessor-based Systems Microprocessor the brais of the computer its job is to fetch istructios, decode them, ad the execute them 8/16/32/etc bit (how it moves the data cotais: Arithmetic Logic Uit Register Arrays Cotrol Uit ALU performs computig tasks maipulates the data/ performs umerical ad logical computatios Registers are used for temp. storage Cotrol uit is used for timig ad other cotrollig fuctios cotais a program couter (ext istructio s address ad status register) System software: A group of programs that moitors the fuctios of the etire system
Remember
Microprocessor-based Systems Memory Memory is a group of registers 16 register address: 0-15 i biary: 0-1111; Address lies: A0-A3 Serves two major purposes q storig the biary codes for the sequece of istructios specified by programs (program) q storig biary data that the computer eeds to execute istructios (data)
Microprocessor-based Systems Memory Types R/W: Read/Write Memory; also called RAM It is volatile (losses iformatio as power is removed) Write meas the processor ca store iformatio Read meas the processor ca receive iformatio from the memory Acts like a Blackboard! ROM: Read-Oly memory; It is typically o-volatile (permaet) ca be erasable It is similar to a Page from your textbook
Microprocessor-based Systems Memory Classificatio Basic Techologies: Semicoductor Magetic Optical (or combiatio) Expesive Fast/ Cheap Slow Oetime programmable Electroically Erasable PROM
Microprocessor-based Systems -oe trasistor ad oe capacitor to store a bit -Leakage problem, thus requires refreshig -Used for dyamic data/program storage -Cheap ad slow! Memory Classificatio -4/6 trasistor to save a sigle bit - Volatile - Fast but expesive Expesive Fast/ Cheap Slow Oetime programmable Electroically Erasable PROM
Erasable ROMs Marked Programmed ROM Programmed by the maufacturer Programmable ROM (PROM) Ca be programmed i the field via the programmer Erasable Programmable ROM (EPROM) Uses ultraviolet light to erase (through a quartz widow) OTP refers to oe-time programmable Electrically Erasable Programmable ROM (EEPROM) FLASH Each program locatio ca be idividually erased Expesive Requires programmer Ca be programmed i-circuit (i-system) Easy to erase (o programmer) Oly oe sectio ca be erased/writte at a time (typically 64 bytes at a time)
Microprocessor-based Systems I/O Ports The way the computer commuicates with the outside world devices I/O ports are coected to Peripherals Peripherals are I/O devices Examples Iput devices Output devices Priters ad modems, keyboard ad mouse scaer Uiversal Serial Bus (USB)
Microprocessor-based Systems - BUS The three compoets MPU, memory, ad I/O are coected by a group of wires called the BUS Address bus cosists of 16, 20, 24, or 32 parallel sigal lies (wires) - uidirectioal these lies cotai the address of the memory locatio to read or writte Cotrol bus cosists of 4 to 10 (or more) parallel sigal lies CPU seds sigals alog these lies to memory ad to I/O ports examples: Memory Read, Memory Write, I/O Read, I/O Write Data bus cosists of 8,16, or 32 parallel sigal lies bi-directioal oly oe device at a time ca have its outputs eabled, this requires the devices to have three-state output
Remember: 111 1111 1111 = 7FF = 2^11-1 = 2047 2^11=2K=2048 2^11 Requires 11 bits Expaded Microprocessor-Based System 1. Note the directios of busses 2. What is the width of the address bus? 3. What is the value of the Address but to access the first register of the R/WM? You must kow how to draw it!
Example 000 001 800 801 2K Registers or bytes of memory 2K Registers or bytes of memory What? How may bits What? How may bits How much memory do we have?
Example 000 001 800 801 2K (2^11 = 2048) Registers or bytes of memory 2K (2^11 = 2048) Registers or bytes of memory 2^11-1=7FF Requires 11 bits FFF Requires 12 bits For a total of 4095 bytes Total of 4K bytes of memory: 2^12 (FFF) à 12 bits ; last values 2^12-1 = 4096-1
Example 8 bits 000 001 1G bytes of memory 30 bits! 2^30-1=3FFF FFFF Next umber: 4000 0000 (i Hex)
Example of a 8-bit MPU A15 A0 ROM 2K 800 RAM 2K FFF D7 D0 8-bit
So what are microcotrollers?
What is a Microcotroller? A microcotroller is a small computer o a sigle itegrated circuit cotaiig processor core, memory, programmable iput/output peripherals Used for specific (embedded) applicatios
Embedded cotrollers Used to cotrol smart machies Examples: priters, auto brakig systems Also called microcotrollers or microcotroller uits (MCU)
Embedded cotrollers Software Characteristics No operatig systems Execute a sigle program, tailored exactly to the cotroller hardware Assembly laguage (vs. High-level laguage) Not trasportable, machie specific Programmer eed to kow CPU architecture Speed Program size Uiqueess
Microcotroller Uit (MCU) Block Diagram A itegrated electroic computig ad logic device that icludes three major compoets o a sigle chip Microprocessor Memory I/O ports Icludes support devices Timers A/D coverter Serial I/O Parallel Slave Port All compoets coected by commo commuicatio lies called the system bus.
First Microcotrollers IBM started usig Itel processors i its PC Itel started its 8042 ad 8048 (8-bit microcotroller) usig i priters Apple Macitosh used Motorola 1980 Itel abadoed microcotroller busiess By 1989 Microchip was a major player i desigig microcotrollers PIC: Peripheral Iterface Cotroller
Differet Microcotrollers (MCU) What is the differece? 8/16/24/32 bits Architecture Package Capability Memory Software (IDE)/cloud ADC (10-12 bit) http://e.wikipedia.org/wiki/microcotroller A more complete list is here: http://e.wikipedia.org/wiki/category:microcotrollers
MCU Architecture RISC Reduced istructio set computer Simple operatios Simple addressig modes Loger compiled program but faster to execute Uses pipeliig Most embedded system CISC Complex istructio set computer More complex istructios (closer to high-level laguage support) x86 stadard (Itel, AMD, etc.), but eve i the maiframe territory CISC is domiat via the IBM/390 chip Bech marks: How to compare MCUs together MIPS: Millio Istructios / secod (Useful whe the compilers are the same)
CISC vs RISC CISC Petium/x86 are CISC-based Complex istructios require multiple cycles May istructios ca referece memory Istructios are executed oe at a time Few geeral registers RISC ARM-based Most mobile-phoes Reduced istructios take 1 cycle Oly Load ad Store istructios ca referece memory Uses pipeliig to execute istructios May geeral registers RISC ad CISC architectures are becomig more ad more alike. *Read the LINK o the web site!*
8-bit Cotrollers (Mai Players) Microchip RISC architecture (reduced istructio set computer) Has sold over 2 billio as of 2002 Cost effective ad rich i peripherals Motorola CISC architecture Has hudreds of istructios Examples: 68HC05, 68HC08, 68HC11 Itel CISC architecture Has hudreds of istructios Examples: 8051, 8052 May differece maufacturers: Philips, Dallas/MAXIM Semicoductor, etc. Atmel RISC architecture (reduced istructio set computer) with CISC istructio set! Cost effective ad rich i peripherals Claims to be very code efficiet less memory for the same code! AVR (Advaced Virtual RISC): TuyAVR, MegAVR, XmegaAVR Freescale Ziglog (Z8) What is the differece? Speed Package Power RAM/ROM IO Pis Software (IDE)/cloud
A Bit About ARMs Architecture (Advaced RISC Machie) ARM desig takes the RISC based computer desig approach Liux like architecture ARM is a British semicoductor (ad software) desig compay that desigs ad liceses ARM processor cores to semicoductor maufacturers They just sell the ARM core Other maufacturers licese the core from them ad the desig microcotrollers aroud that core by addig i peripherals ad memory to suit their desig goals There are differet cores for differet applicatios Cortex-M0/M0+, Cortex-M3, or Cortex-M4.
ARM Processor IP
Applicatios of ARM-Based Microcotrollers Who is usig ARM? Check this out! http://e.wikipedia.org/wiki/list_of_applicatios_of_arm_cores Most Cellphoes!
Desig Examples.. Microcotrollers vs. Microprocessors
MPU-Based Time ad Temperature System
MCU-Based Time ad Temperature System
Refereces Computer History Museum: http://www.computerhistory.org/ Read about microcotrollers: http://www.mikroe.com/e/books/picbook/2_01chapter.htm Lots of good iformatio exist o Wikipedia about microcotrollers http://e.wikipedia.org/wiki/ History of trasistors: http://ivetors.about.com/library/weekly/aa061698.htm Nice trasistor timelie by Itel: http://www.itel.com/techology/timelie.pdf I used a few slides from here: http://www.ceg.metu.edu.tr/courses/ceg336/_documets/itroduct io.pdf ARM related refereces: http://mc2.ul.edu/2013/10/03/gettig-started-with-arm-microcotrollers/ http://www4.cs.fau.de/lehre/ss06/hs_akes/slides/arm.pdf - Very good referece!
Refereces - RISC http://cse.staford.edu/class/sophomorecollege/projects-00/risc/ http://e.wikipedia.org/wiki/complex_istructio_set_co mputer http://e.wikipedia.org/wiki/risc http://arstechica.com/articles/paedia/cpu/pipeliig- 1.ars/4