microprocessors and embedded systems

32
MICROPROCESSORS AND EMBEDDED SYSTEMS BACKGROUND

Upload: emmanuel-mupinga

Post on 14-Sep-2015

227 views

Category:

Documents


1 download

DESCRIPTION

Microprocessors tutorial

TRANSCRIPT

  • MICROPROCESSORS AND EMBEDDED SYSTEMSBACKGROUND

  • CONCEPT OF A MICROPROCESSOR - Digital computer: controlled by a program move and process data using calculating logic circuits, memory circuits and I/O devices.Architecture: Putting together logic circuits to build Calculating logic, memory circuits, I/O devices- The architecture of a computer reduced to single IC to form a circuit called the Microprocessor which increases the speed and computing power of a computer.

  • CONTINUEDA microprocessor has digital circuits for data handling and computation under program controlIt has a data processing capabilities performed by logic circuits (ALU)It is made up of microcircuitsTransistors (logic circuits)

  • CONCEPT OF A MICROPROCESSORA microprocessor is a multipurpose, programmable, clock driven, register based electronic device that reads binary instructions from a storage device called memory, accepts binary data as input and processes data according to instructions and provides results as output.

  • CLASSIFICATIONBased on bit of operation at a time:==> 4 bit. e.g. Intel 4004==> 8 bit. e.g. Intel 8088, Zilog Z80, Z180==> 16 bit. e.g. Intel 8086, 80186, 80286, 80386==> 32 bit. e.g. Intel Pentium, Celeron, AMD Sempron==> 64 bit. e.g. AMD Athlon.Based on the instruction set microprocessors are classified into:==> RISC Reduced Instruction Set Computing. These types of processors are commonly used in ovens, air conditioners, etc.==> CISC Complex Instruction Set Computing. The types of processors are used in desktops, laptops and servers.==>VLIM Very Long Instruction Word:==>Superscalar Processor(RISC & CISC)

  • EVOLUTION OF MICROPROCESSORS1970: From tubes to Intel 4004 ( 46 instructions) with 2,300 transistors and data transfer was 4 bits per second, 740kHz, and a maximum addressable space of 640 bytes.4040 an enhancement of 4004 was introduced in 1972, 60 instructions, 8K program space, interrupt abilitiesIntel released 8008 microprocessor with a speed of 200KHz, 8 bit size, It contained 3,500 transistors and could address memory space of 16KB.8080 microprocessor with 6,000 transistors, clock speed of 2MHz, data transfer of 8 bits and memory address of 64KB8048 in a first 8 bit single chip microcomputer (microcontroller design)

    8048 replaced by 8051 and 8052: 8051 had 2 byte instruction set, 8 bit register , accumulator A1978 saw the introduction of a 16 bit MOS processor: the 80861982: introduction of 80286, with 130 000 transistors1985: Introduction of a multitasking chip 80386: It had a functional unit, execution unit, segment unit, decode unit, bus unit, prefetch unit, 32 registers (general purpose registers, debug registers, test registers, 275 000 transistors486 wit more than 1mil transistors1993: introduction of the pentium when Intel lost bid to trademark the 586

  • Zilog released Z-80 microprocessor with 2.5MHz, contained 8,600 transistors, addressable memory 64KB.Intel 8085 was released in 1976, 5MHz, contained 6,500 transistors, 8 bit data bus.Mos tech introduced 6502 used in apple designsMotorola introduced 6800 seriesIntel introduced 8086 which brought in the x 86 instructions, addressing 1MB of memory.Subsequent release of 80386 and 80486 by Intel saw microprocessors attaining a speed of up to 100MHz or even more

  • Even at a time when Intel presented the first 4004 microprocessor, there was already a demand for microcontrollers: The contemporary TMS1802 from Texas Instruments, designed for usage in calculators, was by the end of 1971 advertised for applications in cash registers, watches and measuring instruments. The TMS 1000, which was introduced in 1974, already included RAM, ROM, and I/O on-chip and can be seen as one of the first microcontrollers, even though it was called a microcomputer.The first controllers to gain really widespread use were the Intel 8048, which was integrated into PC keyboards, and its successor, the Intel 8051, as well as the 68HCxx series of microcontrollers from Motorola.

  • MICROPROCESSOR VS MICROCONTROLLERMicroprocessor CPU is stand-alone, RAM, ROM, I/O, timer are separatedesigner can decide on the amount of ROM, RAM and I/O ports.Expansive /extendabilityversatility /flexibilitygeneral-purposeMicrocontrollerCPU, RAM, ROM, I/O and timer are all on a single chipfix amount of on-chip ROM, RAM, I/O portsfor applications in which cost, power and space are criticalsingle-purpose

  • OVERVIEW OF DIFFERENT TYPES OF MEMORY: Physical device used to store data/programsVOLATILE MEMORY : Primary storage : The data is lost on reboot or when power goes: RAM, SRAM, DRAM

    NON-VOLATILE MEMORY: Secondary storage : The data is saved to a hard drive or flash drive, or it could be a hard coded chip All data that stored in this type of memory will retain when you shutdown your computer. Thus it holds its data even when the power is turned off: ROM. used for the task of secondary storage, or long-term persistent storage. MASKED ROMPROMEPROMEEPROMFLASH

  • contdElectrically addressed non-volatile memories Masked ROMOne of the earliest forms of non-volatile read-only memory, the mask-programmed ROM was prewired at the design stage to contain specific data; once the mask was used to manufacture the integrated circuits, the data was cast in stone (silicon) and could not be changed.The mask ROM was therefore useful only for large-volume production, such as for read-only memories containing the start up code in early microcomputers. This program was often referred to as the bootstrap, as in pulling oneself up by one's own bootstraps.Due to the very high initial cost and inability to make revisions, the mask ROM is rarely used in new designs.Programmable ROMThe programmable ROM contained silicon or metal fuses, which would be selectively blown or destroyed by a device programmer or PROM programmer in order to change 0s to 1s. Once the bits were changed, there was no way to restore them to their original condition. Non-volatile but still somewhat inflexible. Newer Anti-fuse-based PROMs (which are also referred to as one-time-programmable (OTP) memory) are widely used in consumer and automotive electronics, radio-frequency identification devices (RFID), implantable medical devices, and high-definition multimedia interfaces(HDMI) due to their reliability, fast read speed, and long data retention rates.

  • contdErasable PROMsThere are two classes of non-volatile memory chips based on EPROM technology.UV-erase EPROMThe original erasable non-volatile memories were EPROMs: These could be readily identified by the distinctive quartz window in the centre of the chip package. They operated by trapping an electrical charge on the gate of a field-effect transistor in order to change a 1 to a 0 in memory. To remove the charge, one would place the chip under an intense short-wavelength fluorescent ultraviolet lamp, returning the entire chip to its original blank (all ones) state.

  • contd PROMAn OTP has quartz window physically missing. Like the fuse, PROM can be written once, but cannot be erased.Electrically erasable PROMElectrically erasable PROMs have the advantage of being able to selectively erase any part of the chip without the need to erase the entire chip and without the need to remove the chip from the circuit. While an erase and rewrite of a location appears nearly instantaneous to the user, the write process is slightly slower than the read process; the chip can be read at full system speeds.The limited number of times a single location can be rewritten. The capacity of an EEPROM also tends to be smaller than that of other non-volatile memories. EEPROMs are useful for storing settings or configuration for devices ranging from dial-up modems to satellite receivers.Flash memoryThe flash memory chip is a close relative to the EEPROM; it differs in that it can only be erased one block or page at a time. It is a solid-state chip that maintains stored data without any external power source. Capacity is substantially larger than that of an EEPROM, making these chips a popular choice for digital cameras and desktop PC BIOS chips.Flash memory devices use two different logical technologiesNOR and NANDto map data. NOR flash provides high-speed random access, reading and writing data in specific memory locations; it can retrieve as little as a single byte. NAND flash reads and writes sequentially at high speed, handling data in small blocks called pages, But then it is slower on read when compared to NOR. NAND flash reads faster than it writes, quickly transferring whole pages of data. Less expensive than NOR flash at high densities, NAND technology offers higher capacity for the same-size silicon.

  • MICROPROCESSOR SYSTEM

  • contdThe CPU can put a binary number on the address bus, to select an individual register in the ROM or RAM or the I/O. The arrows on this bus show that addresses go one way only. Data at the selected address can be put on the data bus.The CPU can also put data on this bus which can be written into a register of RAM or I/O. It is not possible to write data into ROM (read only memory). Why? This is shown by the single arrow on the ROM data bus and double arrows on the other two. The control bus instructs the chips to do various things, such as when to read or write etc.The clock tells all the chips when to change what they are doing. Like the drill sergeant who shouts "LEFT, RIGHT, LEFT, RIGHT". The crystal control the speed of operation.

  • contdBuses All of the basic components of the computer are tied together by communications paths called buses. A computer bus is simply a parallel collection of conductors that carry data and control signals from one unit to another.Types of Buses Any computer has three major system buses identified by the type of information they carry. The three major system buses are: Address bus, Data bus, Control bus. These buses are actually extensions of the microprocessor's internal communications structures.Address Bus The address bus is a unidirectional pathway that carries addresses generated by the microprocessor to the memory and I/O elements of the computer. The size of the address bus, determined by the number of conductors in the bus, determines the number of memory locations and/or I/O elements the microprocessor can address.

  • contdAddress Bus Size If the address bus is composed of 16 lines (or bits), the microprocessor can generate 65,536 (2 to the power of 16) distinct address codes. If the address bus size is increased to a 20-bit word size, the microprocessor's capability to address memory and I/O elements is increased to 1,048,576 (2 to the power of 20) possible addresses.Addressing Capacity When discussing addressing capacity, it is common to use the letter K (for kilo) to represent 1024 (2 to the power of 10) addresses. Using this terminology, the 16-bit bus example is capable of addressing up to 64 KB of memory, while the 20-bit bus is capable of directly addressing up to 1,000 KB of memory. 1,000 KB of memory is referred to as a megabyte of memory and is denoted by the letter M (MB for megabytes).

  • contdAddress Codes When the microprocessor wishes to access a memory location to perform a Read or Write operation, it does so by placing the appropriate address code on its address pins and generating the proper control signals to perform the operation. The microprocessor uses the same process to access an input or output element. Decoding Circuitry Because the memory unit is normally composed of several memory chips (RAM and ROM), special decoding circuitry is required to select the proper IC and then single out the proper memory location, the input or output device that the microprocessor is trying to address.Data Bus In contrast to the address bus, the data bus is bi-directional in nature. Data flows along the data bus from the microprocessor to memory during a Write operation and from memory to the microprocessor during a Read operation. The direction for data movement is the same for Read and Write operations between the microprocessor and I/O devices.

  • contdSharing the Data Bus Because all the computer elements must share the data bus, any device connected to the bus must have the capability to put its outputs in a high impedance state (floating) when not involved in an operation with the microprocessor. This prevents data from having more than one source placed on the bus at one time.Data Bus Size If two devices attempt to place data on the bus at the same time, confusion and damage to the devices results. The size of the data bus usually corresponds to the word size of the computer. In general, the larger the data bus, the more powerful the system.8-16-32 bits.Control Bus The control bus carries the timing and control signals necessary to coordinate the activities of the entire system. Unlike the other two buses, the control bus signals are not necessarily related to each other. Some are output signals from the microprocessor, others are input signals to the microprocessor from I/O elements. Each different microprocessor type has its own unique set of control signals, which it can generate or respond to.

  • contdTypes of Control Signals Many control bus signals are common to most microprocessors (or similar to those used by most processors). The following are some of the common control signals in use today:System Clock (SYSCLK), Read/Write Line (R/W Line), Memory Read (MEMR), Memory Write (MEMW), I/O Read (IOR), I/O Write (IOW)Clock Control Signal One of the most important control signals in any microprocessor-based system is the system clock. This signal provides the timing information for all the system's activities. Clock signals may be generated on the microprocessor chip, or by special IC signal generators. Microprocessors with internal clock generators usually require that an external crystal be connected to their clock input pins.Read and Write Signals The control bus also carries the signals that enable selected memory or I/O elements for Read and Write operations. These signals may range from a simple Read/Write line (R/W) to a collection of signals such as Memory Read (MEMR), Memory Write (MEMW), I/O Read (IOR), and I/O Write (IOW). These signals are used by the microprocessor in conjunction with addresses on the address bus to perform Read and Write operations at selected memory or I/O locations.

  • contdResearch and write notes on the following:Bus standardsPolling/busy-wait pollingPipeliningHow pipelining increases the performance of a microprocessorInterlockParallel processingMicroprocessor interfacing

  • MICROPROCESSOR PERFORMANCEWord lengthAddressable spaceInstruction execution speedType of a microprocessorCompatibility with software and other hardware

  • Microprocessor ArchitectureArithmetic Logic Unit (ALU)performs a variety of arithmetic and logical function eg comparing two numbers.Contains data processing logicSends data word over the bus to any device connected to the bus Add: decrementSubtract: incrementOR: shift right/leftExclusive OR : complimentChanges data: Arithmetic logic change or test data

    Control unit/Control logic: Acepts and generates external control signals such as read and write and provides timing signals for the entire system. It takes instructions from the instruction register, figures out what is to be done to the data and then gives the command necessary to get the job done

  • MICROPROCESSOR REGISTERSstorage locations called registers that can be used to hold instructions, data, and addresses during processing.SPECIFIC PURPOSE REGISTERSAccumulator(A and B): 8 bit/16 bit - Most versatile registerMajor register that holds data for manipulationArithmetic and logic operations on data use both ALU and the accumulatorIf the operation combines two data words, the accumulator contains one of the data words and the other might be in one of the registers or memory location. The resulting data word is kept in the accumulator replacing the previously stored word.Accumulator also used in data transfer ie data movements between I/O port and memory location or between one memory location and another. When a programmed data transfer is executed, the transfer takes place in two ways; data moves from the source to the accumulator and then from the accumulator to its destination.Explain how a microprocessor with two accumulators use them

  • Program counter : 16 bit to be able to point to any one of different memory locationsKeeps track of what instruction is being used and what the next instruction will beReceives program address data from any other logic function connected to the internal data bus.During execution, the program counter is loaded with a number which is the address of the memory location containing the first program instruction. The instruction is then sent to the memory address register making contents the same. The memory then puts the contents on the data bus. Once the microprocessor fetches instruction from memory the program counter increments and points to the next instruction.

  • Status registerStores the results of certain tests performed during the execution of the program. This makes us write programs that branch to start a new location with the program counter being loaded with a new starting value. Thus the microprocessor uses this register to make decision

  • Stack pointerThe programmer keeps track of the return address in a special area of memory called stack. (LIFO) . The stack pointer points to the next available location

  • Memory address register and logicHolds address of the memory location selectedPoints to instruction word being fetched from memoryOnce the instruction has been decoded the program counter incrementsIf the instruction being executed does not require addressing memory, then the memory address register is used during the fetch cycle.In most microprocessors the length of the memory address register is the same as that of a program counter. Why?Explain the high byte and low byte memory address registers.Receive data from the stack pointer, index register and other devices

  • Instruction registerHolds the instruction the microprocessor in currently executingLoaded by starting the microprocessor on a fetch/execute cycleIts output drives the part of the control logic known as the instruction decorderInstruction cycle = fetch cycle + execute cycleExplain the sequence of the fetch/execute cycle

  • Temporary data registersThe need for temporary data registers arise because the ALU has no data stirage of its ownThese registers support the operations of ALU

  • GENERAL PURPOSE REGISTERSRegister BRegister CRegister DRegister ERegister HRegister L

  • 8085components

    *