YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
  • 8/14/2019 Embedded system for Computers.

    1/12

    Embedded Application Systems 10/21/2009

    1

    21 October 2009 Embedded Application Systems - 1 1

    Embedded App l i ca t i on Sy st e m s - 1

    I n t r o d u c t i o n

    Embedded Application Systems 10/21/2009

    2

    21 October 2009 Embedded Application Systems - 1 2

    Learn ing Objec t ives

    Interpreting Design RequirementsUnderstanding Manufacturers Spec SheetsSelection of Appropriate DevicesInterfacing the CPU to External DevicesQuality by Design:

    Worst Case Design and AnalysisDevelopment and Debug

    You should know how to do the following things after reaching the end of thiscourse:

    Interpret design requirements for the design of an embedded controller

    Read and understand the manufacturer's specification sheets

    Select appropriate ICs for the design

    Design simple I/O (Input/Output) interfaces

    Interface the CPU, memory, and I/O devices to a common bus

    Define the decoding and interconnection of the major components

    Perform a worst case analysis of the timing and loading of all signals

    Understand the software development cycle for a microcontroller Debug and test the hardware and software designs

    These tasks represent the major skills required in the successful application of anembedded micro. In addition, other abilities such as the design andimplementation of simple user programmable logic will be covered as required tosupport the proficient application of the technology.

  • 8/14/2019 Embedded system for Computers.

    2/12

  • 8/14/2019 Embedded system for Computers.

    3/12

    Embedded Application Systems 10/21/2009

    5

    21 October 2009 Embedded Application Systems - 1 5

    Von Neumann Arch i t ec t u r e

    Single Memory for:ProgramsData

    FamiliarMost FlexibleUsed in PCsSpeed Bottle-neck:

    Memory Interface

    There are also differences in the basic CPU architectures used, that tend to reflectthe application. Microprocessor based machines usually have a von Neumann

    architecture that has a single memory for both programs and data to allowmaximum flexibility in allocation of memory.

    The von Neumann machine, with only one memory, requires all instruction anddata transfers to occur on the same interface. This is sometimes referred to as the"von Neumann bottleneck." In common computer architectures, this is the

    primary upper limit to processor throughput.

    This is the architecture of most general purpose CPUs, such as those used in personal computers.

    Embedded Application Systems 10/21/2009

    6

    21 October 2009 Embedded Application Systems - 1 6

    Harva rd Arch i t ec t u r e

    Separate Memory for:Programs andData

    Advantages:FasterOverlap Transfers

    Instruction FetchData Transfer

    Cant execute Data!

    Microcontroller chips, on the other hand, frequently embody the Harvardarchitecture, which have separate memories for programs and data.

    One advantage this has for embedded applications is due to the two types of memory needed for embedded systems.

    Non-volatile memory (Read only memory or ROM) that does not loseits contents upon loss of power.

    Read/write volatile memory (RAM) that loses its contents when power is removed.

    There are two memories in an embedded system, with the fixed program residing

    in non-volatile ROM memory, and the working variable data storage residing involatile RAM.

    The Harvard architecture has the potential advantage of a separate interfaceallowing twice the memory transfer rate by allowing instruction fetches to occur in parallel with data transfers. Unfortunately, in most Harvard architecturemachines, the memory is connected to the CPU using a bus that limits the

    parallelism to a single bus.

  • 8/14/2019 Embedded system for Computers.

    4/12

    Embedded Application Systems 10/21/2009

    7

    21 October 2009 Embedded Application Systems - 1 7

    Bus Or i en t ed Mic roc ompu t e r

    Microprocessor ( P or uP) chips contain only the central processing unit (CPU),while microcontroller chips ( C or uC) include memory and some Input/Output

    (I/O) devices in addition to the CPU.A typical embedded computer consists of the CPU, memory, and I/O. They aremost often connected by means of a shared bus for communication, as shown inthe figure.

    The peripherals on a microcontroller chip are typically timers, counters, serial or parallel data ports, analog-to-digital and digital-to-analog converters that areintegrated directly on the chip. The performance of these peripherals is generallyless than that of dedicated peripheral chips that are frequently used withmicroprocessor chips.

    Embedded Application Systems 10/21/2009

    8

    21 October 2009 Embedded Application Systems - 1 8

    One Chip Microc on t ro l l e r s

    Advantages:Fewer chips requiredLower cost andsmaller size of thewhole deviceLower powerFewer connectionsMore user I/O pinsHigher reliability

    Disadvantages:Reduced flexibilityLimited expansionLimited performanceLimited I/ODesign compromisedto fit everything on

    one chip

    Having the bus connections, CPU, memory, and I/O functions on one chip hasseveral advantages:

    - Fewer chips are required since most functions are already present on the processor chip.

    - Lower cost and smaller size result from a simpler design.

    - Lower power requirements because on-chip power requirements are muchsmaller than external loads.

    - Fewer external connections are required because most are made on-chip, andmost of the chip connections can be used for I/O.

    - More pins are available for user I/O - they aren't needed for the bus.

    - Reliability is higher since there are fewer components and interconnections.

    Of course there are disadvantages too, including:

    - Reduced flexibility: you can't change whats built into the chip

    - Expansion of memory or I/O is limited or impossible

    - Limited speed due to practical limits for a single chip

    - Lower performance I/O because of design compromises to fit everything onone chip

  • 8/14/2019 Embedded system for Computers.

    5/12

    Embedded Application Systems 10/21/2009

    9

    21 October 2009 Embedded Application Systems - 1 9

    Com put e r Des ign Hie ra rchy

    1

    2

    3

    4

    5

    6

    Another way of looking at a computer system is to look at the successivetranslations that occur from the high level code to the electrical signals that are

    really the only means of communication with the hardware. A computer systemcan be broken down into multiple levels or layers to show the translation of aspecific instruction into a form that can be directly processed by the computer hardware. The hierarchical levels are discussed in detail in "Structured Computer Organization," by A.S. Tanenbaum. This hierarchy is shown in the diagram.

    Language translators such as compilers and assemblers translate high level codeinto machine code that can be executed by the processor. The primary focus will

    be from the assembly and machine language level downward.

    Embedded Application Systems 10/21/2009

    10

    21 October 2009 Embedded Application Systems - 1 10

    Dig i t a l Ha rdw are Concep t s

    CPU, memory, and I/O building blocks+ glue logic ( used to connect thevarious building blocks together)The most difficult and important task the hardware designer faces is theproper selection and specification of this glue logic.

    Devices: registers, buffers, drivers and decoders - to adapt the control signalsprovided by the CPU to those of the other devices.

    TTLPLD (programmable logic device) - has become an important device in connecting thebuilding blocks.

    Now microcontroller designers need to acquire the following skills:Interpretation of manufacturers specificationsDetailed, worst case timing analysis and design

    Worst case signal loading analysisDesign of appropriate signal and level conversion circuitsComponent evaluation and selectionProgrammable logic device selection and design

  • 8/14/2019 Embedded system for Computers.

    6/12

    Embedded Application Systems 10/21/2009

    11

    21 October 2009 Embedded Application Systems - 1 11

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (1 )

    The glue logic (used to join the processor,memories, and I/O) is composed of:

    logic gates, composed of:transistors,

    diodes,resistors,and interconnecting wires.

    Embedded Application Systems 10/21/2009

    12

    21 October 2009 Embedded Application Systems - 1 12

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (2 )

    Voltage, Current, and R esistance A battery provides a voltage source for electricity (muchlike a pump provides a pressure source for a fluid).

    Voltage (or pressure) is required to produce current flowin the circuit.Resistance provides a limiting constraint on the amount of current that will actually flow. The resistor will allow acurrent to flow through it that is proportional to thevoltage across it, and inversely proportional to theresistance value. The magnitude of the voltage (V)generated by the battery is developed across the resistor,and the magnitude of the resistance (R), determine thecurrent (I).Note the return current path is often shown as ground, which is the reference voltage used as the zero volts point.

  • 8/14/2019 Embedded system for Computers.

    7/12

    Embedded Application Systems 10/21/2009

    13

    21 October 2009 Embedded Application Systems - 1 13

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (3 )

    The magnitude of the current in thiscase is I = V / R by re-arranging theequation

    V = I * R (this is known as Ohmsla w ).Current flowing through any resistanceresults in the dissipation of power asheat. The power dissipated is:

    P = I 2 R = V*I = V 2 /R. Voltage is sometimes denoted by the

    variable V and sometimes by E, forelectromotive force .

    DiodesThe diode is a simple semiconductor deviceacting as a one way current valve.

    Embedded Application Systems 10/21/2009

    14

    21 October 2009 Embedded Application Systems - 1 14

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (4 )

    TransistorsThe flow analogy can also be used to

    model how a transistor operates in alogic circuit. The transistor is anamplifier. It uses a small amount of energy to control a larger energysource, just as a valve controls a high-pressure water source.

    There are two kinds of transistors:bipolar andfield-effect transistors (FETs).

  • 8/14/2019 Embedded system for Computers.

    8/12

    Embedded Application Systems 10/21/2009

    15

    21 October 2009 Embedded Application Systems - 1 15

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (5 )

    Mechanical SwitchesUseful for direct input to digital circuits.The dual in-line package , or DIP, switch is one of the easiestways to add multiple switches to a microcontroller design. Themechanical switch has extremely low on resistance and high

    off resistance, unlike most semiconductor switches.

    Embedded Application Systems 10/21/2009

    16

    21 October 2009 Embedded Application Systems - 1 16

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (6 )

    CMOS LogicCMOS logic ( complementary symmetry MOS)is another form of MOS logic, based on theuse of two complementary FETs that switchthe output between the power supply andground.In fact, it would be impossible tomanufacture the largest ICs using MOS logic,as the power dissipated by the chip wouldcause it to overheat. This is the main reasonCMOS logic has become the dominant formof logic used for large, complex ICs.CMOS logic uses two switches: one P-channelpull-up transistor, and one N-channel pull-down device to pull the output low or high,one at a time.

    Low levelopen

    High levelopen

  • 8/14/2019 Embedded system for Computers.

    9/12

    Embedded Application Systems 10/21/2009

    17

    21 October 2009 Embedded Application Systems - 1 17

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (7 )

    Logic SymbolsUsed to represent the logic functions in a more

    abstract way.Positive Logic Corresponding TTLLogic Voltages

    0 = false = lowest voltage level 0 = inputvoltages 0 to 0.8 volts (low)

    1 = true = highest voltage level 1 = inputvoltages 2 to 5 volts (high)Logic voltage levels are different fordifferent types of logic, but the mostcommon logic levels are thosecorresponding to the original TTL(Transistor-Transistor Logic ), using a 5 voltpower supply.

    CMOS levels, using 3 or 5 volt power, arealso common. TTL and CMOS logiclikealmost every other type of logic incommon use are called positive logic because the most positive voltagecorresponds to the logic one value.

    Embedded Application Systems 10/21/2009

    18

    21 October 2009 Embedded Application Systems - 1 18

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (8 )

    Tri-State LogicWhen we speak of binary (base two number) values, wemean that a given bit or logic signal can take on either oneof two valid states (zero or one) at any instant in time.

    A logic gate that is not forcing its output to be either oneor zero is said to be tri-stated .Tri-state logic does not refer to base three numbers, butrather to a third invalid logic state when the output of alogic device is neither sinking nor sourcing current. This so-called third state is really an undefined Tri-State LogicTri-state logic does not refer to base three numbers, butrather to a third invalid logic state when the output of alogic device is neither sinking nor sourcing current. This so-called third state is really an undefined condition, becausethe device output is not forcing a logic level on its output.It is said to be in a floating, high impedance, passive, or Hi-Z state , since the output circuits are effectivelydisconnected.

  • 8/14/2019 Embedded system for Computers.

    10/12

    Embedded Application Systems 10/21/2009

    19

    21 October 2009 Embedded Application Systems - 1 19

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (9 )

    Timing DiagramsThe standard language of illustrating timing relationships betweendifferent parts of a design.Figure shows examples of asynchronous (un-clocked or combinatorialgates) and synchronou s (clocked flip-flop) logic.

    Embedded Application Systems 10/21/2009

    20

    21 October 2009 Embedded Application Systems - 1 20

    Re v i ew o f b a si c e l e c t r o n ic s c o nc e pt s (1 0)

    Timing relationships areparticularly important forsignals that are time sharedon a single wire. A group of wires that carries differentinformation at different times isalso called a bu s .

    Multiplexed BusIn order to describe the timing of

    a shared data bus, it is

    necessary to define somenotation for timing diagrams.The notation used is shown inFigure.

  • 8/14/2019 Embedded system for Computers.

    11/12

    Embedded Application Systems 10/21/2009

    21

    21 October 2009 Embedded Application Systems - 1 21

    Typic a l C Bloc k Diagram

    There are three groups of signals, or buses, that connect the CPU to the other major components. The buses are: Data Bus, Address Bus, Control Bus

    The interconnection between the CPU, memory, and I/O of the address and data buses is generally a one-to-one connection in most cases. The hard part isdesigning the appropriate circuitry to adapt the control signals present on eachdevice to be compatible with that of the other devices. The most basic controlsignals are generated by the CPU to control the data transfers between the CPUand memory, and between the CPU and I/O devices. The address decoder isresponsible for recognizing the addresses of individual devices connected to the

    bus and enabling them when selected. The four most common types of CPUcontrolled data transfers are:

    1) CPU reads data/instructions from memory (memory read)

    2) CPU writes data to memory (memory write)3) CPU reads data from an input device (I/O read)

    4) CPU writes data to an output device (I/O write)

    Herein, read and input will be used interchangeably. These terms refer to thetransfer of information from an external source into the CPU. Write and outputwill be used to denote the transfer of data from the CPU to an externaldestination. The data direction is defined with respect to the CPU.

    Embedded Application Systems 10/21/2009

    22

    21 October 2009 Embedded Application Systems - 1 22

    Mem ory Read/Wri t e Cyc les

    The address decode and control logic shown in block diagram the previous slideis the key part of the design, which requires attention to timing analysis toguarantee signal logic and timing compatibility between the other blocks. Thesimplified timing diagram for such a system is shown for a simple memory readand write cycle. This is a generic diagram and represents a typical example of a

    bus cycle.

    We see that there are two cycles:

    Memory Read: The processor places an address on the address bus, andactivates the memory read signal by pulling it low, which causes theselected memory location to be placed on the data bus.

    Memory Write: The processor places an address on the address bus, datato be written on the data bus, and activates the memory read signal by

    pulling it low, which causes the selected memory location to be loadedwith the data the CPU placed on the data bus.

  • 8/14/2019 Embedded system for Computers.

    12/12

    Embedded Application Systems 10/21/2009

    23

    21 October 2009 Embedded Application Systems - 1 23

    Summary

    ReviewMicrocontroller Applications

    Architecture Address, Data and Control BusesData Transfer Timing

    Extended Use of Embedded IntelligenceRequirement for High Reliability

    There is an incredible diversity of applications for embedded processors. Most people are aware of the highly visible applications, but there are many lessapparent uses. They range from the keyfob transmitter used in automotive anti-theft systems to the 1000+ micros in the Boeing 777s various electronic systems.

    Embedded Application Systems 10/21/2009

    24

    21 October 2009 Embedded Application Systems - 1 24

    Ques t ions

    Why is the Harvard architecture potentially faster thanthe von Neumann?What additional functions are in a C chip that are not included in a P?What are the six levels of hierarchy of computer design?Name the three buses present in a microcontrollersystem.

    From what point of reference are the terms read andwrite defined?What is the purpose of the address decoder?

    Why is the Harvard architecture potentially faster than the von Neumann?

    The Harvard, since there are two memory buses, one for program and one

    for data. This allows the potential for twice as much information to be processed in the von Neumann architecture, which has only one memory.

    What additional functions are in a uC chip that are not included in a uP?

    The uC (microcontroller) has non-volatile program memory, volatile datamemory, and I/O.

    What are the six levels of hierarchy of computer design?

    High level, Assembly, Machine, Register Transfer, Gate, and Circuit.

    Name the three buses present in a microcontroller system .

    Address, Data, and Control.

    From what point of reference are the terms read and write defined?

    The CPU. Data into the CPU is Read, out is Write.

    What is the purpose of the address decoder?

    The address decoder is responsible for recognizing the addresses of individual devices connected to the bus and enabling them when selected.


Related Documents