Fundamentals Of Chapter 1 Microprocessor And Microcontroller

3y ago
22 Views
3 Downloads
3.34 MB
69 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Rafael Ruffin
Transcription

Fundamentals ofChapter 1Microprocessor andMicrocontrollerDr. Farid FarahmandUpdated: 4/2/16

A little HistorynWhat is a computer? [Merriam-WebsterDictionary] one thatcomputes; specifically : programmableelectronic device that can store, retrieve, andprocess data. [Wikipedia] A computer is a machine thatmanipulates data according to a list ofinstructions.nClassification of Computers (power and price) Personal computersMainframesSupercomputersDedicated controllers – Embedded controllers

MainframesnThe First Mainframes nBig businesses with big needs required big computers.Economies of scale also favored large, consolidated computersystems.The Second Mainframes Transistor-based computers were replacing vacuum-tubemachines in the late 1950s, spurred developments in hardwareand software. Manufacturers commonly built small numbers ofeach model, targeting narrowly defined markets.

MainframesMassive amounts of memoryn Use large data words 64 bits or greatern Mostly used for military defense and largebusiness data processingn Examples: IBM 4381, Honeywell DPS8n

Personal ComputersnAny general-purpose computer Intended to be operated directly by an endusernRange from small microcomputers that work with 4-bitwords to PCs working with 32-bit words or moreThey contain a Processor - called different namesn Microprocessor– built using Very-Large-ScaleIntegration technology; the entire circuit is ona single chip Central Processing Unit (CPU) Microprocessor Unit (MPU) – similar to CPUhttp://en.wikipedia.org/wiki/Personal computer

SupercomputersnFastest and most powerful mainframes Contain multiple central processors (CPU)Used for scientific applications, and number crunchingNow have teraflops performancennnFLoating Point Operations Per Second (FLOPS)Used to measure the speed of the computerExamples of special-purpose supercomputers: Belle, Deep Blue, and Hydra, for playing chessReconfigurable computing machines or parts of machinesGRAPE, for astrophysics and molecular dynamicsDeep Crack, for breaking the DES cipherMDGRAPE-3, for protein structure ter

Microcontrollers –Embedded SystemsnnAn embedded system is a special-purpose computersystem designed to perform one or a few dedicatedfunctions often with real-timeAn integrated device which consists of multiple devices nMicroprocessor (MPU)MemoryI/O (Input/Output) portsOften has its own dedicated software

A little aboutMicroprocessor-basedSystems

EvolutionnnFirst came transistorsIntegrated circuits n1- Microprocessors (MPU) nSSI (Small-Scale Integration) to ULSIVery Large Scale Integration circuits (VLSI)Microcomputers (with CPU being a microprocessor)Components: Memory, CPU, Peripherals (I/O)Example: Personal computers2- Microcontroller (MCU) Microcomputers (with CPU being a microprocessor)Many special function peripheral are integrated on a singlecircuitTypes: General Purpose or Embedded System (with specialfunctionalities)

Microprocessor-Based Systems Central Processing Unit (CPU) Memory Input/Output (I/O) circuitry Buses– Address bus– Data bus– Control bus

Control UnitMicroprocessor-based System

Microprocessor-Based System withBuses: Address, Data, and Control

Microprocessor-based SystemsMicroprocessorn Themicroprocessor (MPU) is a computing andlogic device that executes binary instructions in asequence stored in memory.n Characteristics: Generalpurpose central processor unit (CPU) Binary Register-based Clock-driven Programmable

Microprocessor-based SystemsMicroprocessornthe “brains” of the computer nits job is to fetch instructions, decode them, and then execute them8/16/32/etc –bit (how it moves the rol UnitALU performs computing tasks – manipulates the data/ performs numerical and logicalcomputationsRegisters are used for temp. storageControl unit is used for timing and other controlling functions – contains a programcounter (next instruction’s address and status register)System software: A group of programs that monitors the functions of the entire system

Let’s Review a Few ThingsFirst

UnsignedData Format (8-bit) (1 of 4)nSignedUnsigned Integers: All eight bits (Bit0 toBit7) represent the magnitude of a number Range0 to FF in Hex and 0 to 255 in decimal

UnsignedData Format (8-bit) (2 of 4)nSignedSigned Integers: Seven bits (Bit0 to Bit6)represent the magnitude of a number. The8th bit (Bit7) represents the sign of anumber. The number is positive when Bit7is zero and negative when Bit7 is one. Positive numbers: 0 to 7F (0 to 127) Negative numbers: 80 to FF (-1 to -128) All negative numbers are represented in2’s complement

Data Format (8-bit) (3 of 4)nBinary Coded Decimal Numbers (BCD) 8bits of a number divided into groups of four,and each group represents a decimal digitfrom 0 to 9 Four-bit combinations from A through F in Hexare invalid in BCD numbersnExample: 0010 0101 represents the binary codingof the decimal number 25d which is different invalue from 25H.

Data Format (8-bit) (4 of 4)nAmerican Standard Code for InformationInterchange (ASCII) Seven-bitalphanumeric code with 128combinations (00 to 7F) Represents English alphabet, decimal digitsfrom 0 to 9, symbols, and commands

Back to the Main Point Evolution of CPUs

DigitalLogic

TransistorsnnVacuum Tubes: A devise to control,modify, and amplify electric signalsThen came transistors Designed by John Bardeen, WilliamShockley, and Walter Brattain,scientists at the Bell TelephoneLaboratories in Murray Hill, NewJersey – 1947

TransistorsnnnIn September 1958 Jack Kilby ofTexas Instruments, Dallas, TXdemonstrated the industry's firstintegrated flip-flop.TI announced Kilby’s germanium“Solid Circuit” conceptRobert Noyce had co-founded theFairchild Semiconductor Corporation –he was also working on how to makemore of less.Jack Kilby was awarded the Nobel Prize in Physics in 2000 for his role as coinventor with Robert Noyce of the integrated circuit. Noyce did not receive the awardas he died on June 3, 1990.

Integrated CircuitsnnnAdvances inmanufacturing allowedpacking more transistorson a single chipTransistors andIntegrated Circuits fromSSI (Small-ScaleIntegration) to ULSIBirth of a microprocessorand its revolutionaryimpact

MicroprocessorsnnnNoyce and GordonMoore started IntelIntel designed he firstcalculatorIntel designed the firstmicroprocessor in 1971 Model 4004 4-bit; 2300 transistors,640 bytes of memory,108 KHz clock speed

First ProcessorsnnnnnIntel released the 8086, a 16-bit microprocessor,in 1978Motorola followed with the MC68000 as their 16bit processor The 16-bit processor works with 16 bit words,rather than 8 bit words Instructions are executed faster Provide single instructions for more complexinstructions such as multiply and divide16 bit processors evolved into 32 bit processorsIntel released the 80386Motorola released the MC68020

Evolution of CPUsIn 1965, Gordon Moore, co-founder of Intel, indicated that the number of transistors per square inch on integratedcircuits had doubled every year since the integrated circuit was invented. Moore predicted that this trend wouldcontinue for the foreseeable future.

Evolution of CPUsnTukwila World's First 2-Billion TransistorMicroprocessor - Next-generation Intel Itanium processors (codenamed Tukwila)2010: Intel Itanium Tukwila MPU, 2000M transistor2010 AMD Operon 6100 MPU, 1800 transistors2006 Nvidia G80, 681M transistors1994 Motorola 68060 MPU, 2M cture-silicon/2billion.htm

Remember

Microprocessor-based SystemsMemorynMemory is a group of registersnn16 register – address: 0-15 – in binary:0-1111; Address lines: A0-A3Serves two major purposesqqstoring the binary codes for the sequence ofinstructions specified by programs (program)storing binary data that the computer needsto execute instructions (data)

Microprocessor-based SystemsMemory Types R/W:It is volatile (losses information as power isremoved)n Write means the processor can store informationn Read means the processor can receive informationfrom the memoryn Acts like a Blackboard!ROM: Read-Only memory;n It is typically non-volatile (permanent) – can beerasablen It is similar to a Page from your textbookn Read/Write Memory; also called RAM

Microprocessor-based SystemsMemory ClassificationBasic Technologies:SemiconductorMagneticOptical(or combination)ExpensiveFast/CheapSlowOnetime programmableElectronically ErasablePROM

Microprocessor-based-one transistor and one Systemscapacitor to store a bitMemory Classification-Leakage problem, thusrequires refreshing-Used for dynamic data/program storage-Cheap and slow!-4/6 transistor tosave a single bit- Volatile- Fast butexpensiveExpensiveFast/CheapSlowOnetime programmableElectronically ErasablePROM

Erasable ROMsnMarked Programmed ROM nProgrammable ROM (PROM) n Uses ultraviolet light to erase (through a quartz window)OTP refers to one-time programmableElectrically Erasable Programmable ROM (EEPROM) nCan be programmed in the field via the programmerErasable Programmable ROM (EPROM) nProgrammed by the manufacturerEach program location can be individually erasedExpensiveRequires programmerFLASH Can be programmed in-circuit (in-system)Easy to erase (no programmer)Only one section can be erased/written at a time (typically 64 bytes at a time)

Microprocessor-based SystemsI/O PortsnnThe way the computer communicates with theoutside world devicesI/O ports are connected to Peripherals Peripherals are I/O devicesnn Input devicesOutput devicesExamplesnnnnPrinters and modems,keyboard and mousescannerUniversal Serial Bus (USB)

Microprocessor-basedSystems - BUSnThe three components – MPU, memory, and I/O – are connected by agroup of wires called the BUSnAddress busnnnControl bus nconsists of 16, 20, 24, or 32 parallel signal lines (wires) - unidirectionalthese lines contain the address of the memory location to read or writtenconsists of 4 to 10 (or more) parallel signal linesCPU sends signals along these lines to memory and to I/O portsn examples: Memory Read, Memory Write, I/O Read, I/O WriteData bus consists of 8,16, or 32 parallel signal linesbi-directionalonly one device at a time can have its outputs enabled,this requires the devices to have three-state output

Remember: 111 1111 1111 7FF 2 11-1 20472 11 2K 20482 11 Requires 11 bitsExpanded Microprocessor-Based System1. Note the directionsof busses2. What is the width ofthe address bus?3. What is the value ofthe Address but toaccess the firstregister of the R/WM?You must know how todraw it!

Example8000008010012KRegisters or bytes ofmemoryWhat?How many bitsHow much memory do we have?2KRegisters or bytes ofmemoryWhat?How many bits

Example8000008010012K(2 11 2048)Registers or bytes ofmemory2 11 -1 7FFRequires 11 bits2K(2 11 2048)Registers or bytes ofmemoryFFFRequires 12 bitsFor a total of 4095 bytesTotal of 4K bytes of memory: 2 12 (FFF) à 12 bits ; last values 2 12-1 4096-1

Example8 bits0000011G bytes of memory30 bits!2 30 -1 3FFF FFFFNext number: 4000 0000 (in Hex)

Example of an 8-bit MPUA15A0800RAM2KROM2KFFFD7D08-bit

So what aremicrocontrollers?

What is a Microcontroller?nA microcontroller is a small computer on asingle integrated circuit containing processorcore, memory, programmableninput/output peripheralsUsed for specific (embedded) applications

Embedded controllersUsed to control smart machinesn Examples: printers, auto braking systemsn Also called microcontrollers ormicrocontroller units (MCU)n

Embedded controllersSoftware CharacteristicsnnnNo operating systemsExecute a single program, tailored exactly to thecontroller hardwareAssembly language (vs. High-level language) Not transportable, machine specific Programmer need to know CPU architecture Speed Program size Uniqueness

Microcontroller Unit (MCU)Block DiagramnAn integrated electronic computing and logic device thatincludes three major components on a single chip nIncludes support devices nMicroprocessorMemoryI/O portsTimersA/D converterSerial I/OParallel Slave PortAll components connected by common communicationlines called the system bus.

First MicrocontrollersnnnnIBM started using Intel processors in its PC Intel started its 8042 and 8048 (8-bitmicrocontroller) – using in printersApple Macintosh used Motorola1980 Intel abandoned microcontroller businessBy 1989 Microchip was a major player indesigning microcontrollers PIC: Peripheral Interface Controller

Different Microcontrollers hat is the difference?8/16/24/32 bitsArchitecturePackageCapabilityMemorySoftware (IDE)/cloudADC (10-12 bit)A more complete list is here: lers

MCU ArchitecturennRISC Reduced instruction set computer Simple operations Simple addressing modes Longer compiled program but faster to execute Uses pipelining Most embedded systemCISC Complex instruction set computer More complex instructions (closer to high-level languagesupport) x86 standard (Intel, AMD, etc.), but even in the mainframeterritory CISC is dominant via the IBM/390 chipBench marks: How to compare MCUs togetherMIPS: Million Instructions / second (Useful when the compilers are the same)

CISC vs RISCCISCPentium/x86 are CISC-basedRISCARM-basedMost mobile-phonesComplex instructions requiremultiple cyclesReduced instructions take 1cycleMany instructions can referencememoryOnly Load and Store instructionscan reference memoryInstructions are executed one ata timeUses pipelining to executeinstructionsFew general registersMany general registersRISC and CISC architectures are becoming more and more alike.*Read the LINK on the web site!*

A Bit About ARMsArchitecture (Advanced RISC Machine)nnARM design takes the RISC based computer designapproach – Linux –like architectureARM is a British semiconductor (and software) designcompany that designs and licenses ARM processorcores to semiconductor manufacturers nThey just sell the ARM coreOther manufacturers license the core from them and then designmicrocontrollers around that core by adding in peripherals andmemory to suit their design goalsThere are different cores for different applications Cortex-M0/M0 , Cortex-M3, or Cortex-M4.

ARM Processor IP

Applications of ARM-BasedMicrocontrollersWho is using ARM? Check this out!http://en.wikipedia.org/wiki/List of applications of ARM coresMost Cellphones!

Back to Our 8-bit Controllers (Main Players)nMicrochip nMotorola n nWhat is the difference?SpeedPackagePowerRAM/ROMIO PinsSoftware (IDE)/cloudCISC architectureHas hundreds of instructionsExamples: 8051, 8052Many difference manufacturers: Philips, Dallas/MAXIM Semiconductor, etc.Atmel nCISC architectureHas hundreds of instructionsExamples: 68HC05, 68HC08, 68HC11Intel nRISC architecture (reduced instruction set computer)Has sold over 2 billion as of 2002Cost effective and rich in peripheralsRISC architecture (reduced instruction set computer) – with CISC instruction set!Cost effective and rich in peripheralsClaims to be very code efficient – less memory for the same code!AVR (Advanced Virtual RISC): TunyAVR, MegAVR, XmegaAVRFreescaleZiglog (Z8)

What you Need to UseMicrocontrollersnnA target - the actual microcontrollerA toolchain — this is the software you use to write yourcode nMost developers use an IDE — integrated development environment —which contains a text editor, plus functionality for compiling anddownloading your programs to the targetThe toolchain can be locally installed or on cloud!A Programmer/debugger — this is the device thatconnects the computer to the microcontroller todownload code to it Your PICKIT3!Allows real-time debugging of the program

Programming MCUs .nMemory devices can store two types ofinformation: Data(RAM) Programs(a series of instructions that tell theMPU in the microcontroller what to do!) - ROM

MemoryA semiconductorstorage deviceconsisting ofregisters that storebinary bitsn Two majorcategoriesn Read/WriteMemory (R/WM) Read-only-Memory(ROM)

Storing Bits in MemorynWe can store in different memorytypes nEEPROM, FLASH, RAM, etc.In an 8-bit RAM Each byte is stored in a singlememory registerEach word is stored in two memorylocations (registers)DATA 0x1234n0x12àREG11 (High-order byte) n0001 00100x34àREG10 (Low-order byte) 0011 0100Whatif we1000wantstore complement)-8?Remember-8à111(intotwo’s

Symbolic Representation ofProgram Memory ContentsnAddressesRegistersWhat is the address bus value?CODE:READ PORT AWRITE PORT BSTOPFetch / Decode /ExecutePORT A 8000HPORT B 8001H

So, How Do We Right theInstructions and Tell the MPU Whatto Do? We use a Software Language

Software: From Machine toHigh-Level Languages (1 of 3)nHigh-level LanguageAssembly LanguageMachine LanguageMachine Language: binary instructions Allprograms are converted into the machinelanguage of a processor for execution Difficultto decipher and write Prone to cause many errors in writing

Software: From Machineto High-Level Languages (2 of 3)nHigh-level LanguageAssembly LanguageMachine LanguageAssembly Language: machine instructionsrepresented in mnemonics Hasone-to-one correspondence with machineinstructions Efficient in execution and use of memory;machine-specific and not easy to troubleshoot

High-level LanguageSoftware: From Machineto High-Level Languages (3 of 3)nAssembly LanguageMachine LanguageHigh-Level Languages (such as BASIC, C,and C ) Writtenin statements of spoken languages(such as English)machine independentn easy to write and troubleshootn requires large memory and less efficient inexecutionn

Design Examples .Microcontrollers vs. Microprocessors

MPU-Based Timeand Temperature System

MCU-Based Timeand Temperature System

ReferencesnnnnnnnComputer History Museum: http://www.computerhistory.org/Read about cbook/2 01chapter.htmLots of good information exist on Wikipedia about ry of kly/aa061698.htmNice transistor timeline by I used a few slides from here:http://www.ceng.metu.edu.tr/courses/ceng336/ documents/introduction.pdfARM related references: SS06/HS AKES/slides/ARM.pdf - Very good reference !

References - i/Complex instruction set /4

Personal Computers n Any general-purpose computer Intended to be operated directly by an end user n Range from small microcomputers that work with 4-bit words to PCs working with 32-bit words or more n They contain a Processor - called different names Microprocessor – built using Very-Large-Scale Integration technology; the entire circuit is on

Related Documents:

Part One: Heir of Ash Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26 Chapter 27 Chapter 28 Chapter 29 Chapter 30 .

TO KILL A MOCKINGBIRD. Contents Dedication Epigraph Part One Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Part Two Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18. Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26

DEDICATION PART ONE Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 PART TWO Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 .

Microprocessor-Based System with Buses: Address, Data, and Control Microprocessor-based Systems Microprocessor ! The microprocessor (MPU) is a computing and logic device that executes binary instructions in a sequence stored in memory. ! Characteristics: " General purpo

A microprocessor which has n data lines is called an n-bit microprocessor i.e., the width of the data bus determines the size of the microprocessor. Hence, an 8-bit microprocessor like 8085 can handle 8-bits of data at

36 Chapter 3 Microprocessor Types and Specifications Pre-PC Microprocessor History The brain or engine of the PC is the processor (sometimes called microprocessor), or central processing u

1 Introduction to Microcomputer Microcomputer architecture, organization and its operation. Difference between Microprocessor and Microcontroller. 1 [1] Lecture Notes Introduction to Microprocessor Evolution of Microprocessor, General Architecture, system bus 2 [1] [2] Lecture Notes 2 Functional units of Microprocessor

A microprocessor can move data from one memory location to another. A microprocessor can make decisions and jump to a new set of instructions based on those decisions. There may be very sophisticated things that a microprocessor