Docstoc

Chapter 1 _ppt slides_ - CSE325 Embedded Microprocessor Systems

Document Sample
Chapter 1 _ppt slides_ - CSE325 Embedded Microprocessor Systems Powered By Docstoc
					CSE325

Embedded Microprocessor Systems

Section 1: Introduction to
Embedded Systems and ES
Software Development

                        Kevin Burger

           Dept. of Computer Science & Engineering
                    Arizona State University

                        Spring 2009

                                                 Much of this material was borrowed from
                                                 other sources. See the references at the
                                                 end for the relevant links.
         Intro to Embedded Systems: What is an Embedded System?

    Any device that incorporates a computer in its implementation. We
    say it is an embedded (computer) system. Note that the device/
    product is not a computer; it just uses a computer to implement it's
    functionality.
    Users of the device are often not even aware that the computer is
    present. In fact, they do not need to be.
    The computer is used primarily to provide flexibility and to simplify
    the system design.
         Generally it is easier and faster to write software than to design and debug
         hardware (although this is changing with the advent of hardware descrip-
         tion languages and reconfigurable hardware).
         Software is very flexible; easily changed. Traditionally, hardware is not
         easily changed (this is changing).
         Post-production bugs are relatively easy to correct; just update the
         software (however, this is not always straightforward or cheap).
         New features can be added after the initial version by augmenting the
         software. Users can purchase updates ==> revenue $$$.
Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   2
                                  Intro to Embedded Systems: Volume

  The number of embedded microprocessor systems far exceeds the
  number of desktop computer systems. (Reports of 100 to 1 in the
  references).
  Embedded microprocessors account for most of the world's pro-
  duction of microprocessors.



 These are 1970's era
 processors

                                                                                       Old graph. Where's
                                                                                       64-bit?




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                        3
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   4
           Intro to Embedded Systems: Example Embedded Systems


                                                         Hard drive controller card.




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   5
           Intro to Embedded Systems: Example Embedded Systems




                                                                      Virtually all printers.
                                                                      HP LaserJet 4100 uses PMC-Sierra
                                                                      RM5261 64-bit MIPS processor with
                                                                      125MHz system bus.
                                                                      Ref: www.rechargermag.com/articles/30377




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                             6
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   7
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   8
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   9
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   10
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   11
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   12
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   13
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   14
           Intro to Embedded Systems: Example Embedded Systems




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   15
     Intro to Embedded Systems: Digital System Design Approaches

  Three approaches to designing and building a digital system are
  used (these are not necessarily distinct):
        Special purpose hardware
        General purpose hardware
        Reconfigurable hardware

  Build special purpose hardware.
        A custom VLSI integrated circuit (at the transistor level). Takes time
        and money but can be very efficient and cost effective in large vol-
        umes, say more than 100,000 units.
        Application Specific Integrated Circuits (ASIC's) are related.
        Advantages: greater speed, lower production costs, lower power-
        consumption.
        Disadvantages: very high development costs, longer time-to-market,
        inflexible (i.e., not easily or cheaply changed).

Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   16
     Intro to Embedded Systems: Digital System Design Approaches

  Use a general purpose processor.
        Microprocessor (MPU): CPU (control + datapath) on a single IC. To
        build a complete system must usually include external RAM, ROM,
        memory controllers, bus controllers, timers, etc.
        Microcontroller (MCU): A microprocessor emphasizing high integration,
        low power consumption, and cost effectiveness. Integrates additional
        elements such as RAM, ROM, EEPROM, Flash, timers, interrupt
        controllers, UART's, watchdog timers, PWM generators, A/D and D/A
        converters, general purpose I/O pins, etc. onto the same chip as the
        CPU.
        Huge number to choose from with many different manufacturers: Intel,
        AMD, TI, ARM, MIPS, Renesas, etc.
        Many manufacturers design microcontrollers with specific applications
        in mind (e.g., automotive, cell phones, MP3 players, military).
        Advantages: lower development costs, more flexible, less time to
        market. Disadvantages: must write sw, slower than custom hardware,
        more power hungry than a dedicated VLSI circuit.
Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   17
     Intro to Embedded Systems: Digital System Design Approaches

  Design the hardware in a field programmable gate array.
        An FPGA is basically programmable digital logic. Write code (i.e., the
        hw design) in VHDL, Verilog, SystemC, or some other hardware
        description language (HDL), and synthesize design using vendor tools.
        Major players: Xilinx, Altera, Lattice.
        Possibly also embed a general-purpose programmable micropro-
        cessor, DSP processor, RAM, ROM, multipliers, etc.
        Advantages: a compromise between special purpose hw and a general
        purpose microprocessor system. An attempt to gain the advantages of
        each.


  In CSE325 we focus on building embedded systems using general
  purpose microprocessors and microcontrollers. In particular, we
  focus on software development of such systems.
  In CSE320 the focus is on building digital systems using FPGA's,
  and in particular on software development of such systems.
Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   18
    Intro to Embedded Systems: Major Microcontroller Manufacturers

  AMD                                        www.amd.com

  Analog Devices                             www.analog.com/processors

  ARM                                        www.arm.com/products/CPUs/embedded.html (IP)

  ATMEL                                      www.atmel.com/products/

  Freescale*                                 www.freescale.com (formerly Motorola; use the ColdFire MCU)

  Intel                                      www.intel.com

  Maxim                                      www.maxim-ic.com/products/microcontrollers

  Microchip                                  www.microchip.com (Popular PIC microcontrollers)

  MIPS                                       www.mips.com/products/processors (IP)

  Renesas                                    america.renesas.com (formerly Hitachi)

  TI                                         focus.ti.com

  Toshiba                                    www.semicon.toshiba.co.jp/eng/product/micro

  ZiLOG                                      www.zilog.com



Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                       19
    Intro to Embedded Systems: Embedded Systems Characteristics

  Or, what's the difference between designing an embedded micro-
  processor system and a typical desktop computer system?

  Embedded systems are often real-time which means that pre-
  defined timing constraints must be satisfied.
        Hard real-time systems are those in which failure to meet a deadline is
        catastrophic (e.g., anti-lock braking system or airbag system). If a
        deadline is not met, the system fails, which could mean great property
        damage or loss of life.
        Soft real-time systems are those which have deadlines but failure to
        meet a deadline is not catastrophic. Instead, deadline failure may lead
        to degredation of service (e.g., dropping video frame or skipping an
        MP3 frame).




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   20
    Intro to Embedded Systems: Embedded Systems Characteristics

  Embedded systems are self-starting.
        Starting or powering up the deveice causes the microcontroller to begin
        execution and "boot" the system.
        This happens without the user's knowledge.
        Watchdog timers are generally essential.
  Cost
        Many products, especially widely-used consumer products, are very
        cost-sensitive (spending only a few additional pennies on a part may
        not be an option; in other words, you may have to make the sw work
        with the hw you're given).
        Microcontrollers are often used because developing software (embed-
        ded sw is often called firmware) is a one-time expense (it is a non-
        recurring expense) and can lower production costs.




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   21
    Intro to Embedded Systems: Embedded Systems Characteristics

  An embedded system must exhibit high reliability.
        A software failure could be catastrophic.
              Therac-25: en.wikipedia.org/wiki/Therac-25
              Panamanian radiation deaths: www.thepanamanews.com/pn/v_10/issue_01/science_01.html
              French Arianne 5 rocket.
        Post-production sw bugs are bad; sw may be difficult, costly, or
        impossible to update--if not designed properly.
  Power consumption may be restricted.
        Embedded systems are often located in devices which run on battery
        power.
        Software must be aware of this (e.g., wireless sensor networks and
        routing protocols).
        Many embedded MCU's today are designed for low power consump-
        tion. Finding effective ways to further reduce power consumption is a
        very active area of research in computer engineering.


Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                22
    Intro to Embedded Systems: Embedded Systems Characteristics

  Performance
        Generally, embedded system exhibit limited processing power and
        memory.
        General rule of thumb is to build the system with the cheapest MCU
        that is capable of getting the job done (i.e., don't put an Intel Xeon
        processor in a toaster).
        4-, 8-, and 16-bit MCU's are still 64-bit
        very popular.
        5, 40, 80 MHz MCU's versus         32-bit

        3-4 GHz microprocessors.
                                           16-bit
        16-256KB of memory is not
        unusual; 2 GB of memory is          8-bit

        unusual.
                                            4-bit
        Some small 4- or 8-bit MCU's
                                              0.00% 10.00% 20.00% 30.00% 40.00% 50.00% 60.00%
        only have a few bytes of RAM.
                                                                                Word-sizes of embedded microcontrollers


Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                                      23
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development
        Concurrency is the norm, e.g., multiple I/O pins or ports must be
        monitored concurrently.
        Real-time embedded systems are usually event-driven. That is, the
        system must recognize when events occur and must handle them,
        often immediately and within some predetermined time limit. External
        events are often communicated to the software via interrupts.
        Programmers write interrupt handlers to handle interrupts. The
        software must properly handle multiple interrupts when they occur. This
        leads to an interrupt priority scheme.
        For example, consider a cell phone. I am currently in the process of
        entering a new phone number into the address book and an incoming
        call is detected. Which of these should have higher priority?
        Exception handling is a critical part of the software. What happens if
        we divide by 0?



Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   24
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        Software and hardware are often designed and developed in parallel. If
        the code doesn't work is it the sw or hw?
        Special software tools can be used to start sw development before
        hardware is available (simulators, emulators, manufacturer develop-
        ment boards).
        Availability, cost, and performance of software development tools can
        affect processor choice (e.g., the 8051 has been around for a long time and
        is widely used so there are a lot of development tools for that chip; for a new
        chip there may only be one compiler or assembler available and it may not be
        very good).
        Buy an OS or roll your own?
              A simple application may not need an operating system. A simple loop may
              be used to execute different tasks, or in a multitasking system, an executive
              may be written to control task scheduling.
              Desktop OS's are not designed for embedded systems. Real-time operating
              systems (RTOS's) such as Windows CE Embedded, Wind River VxWorks,
              embedded Linux, Green Hills INTEGRITY, or Symbian OS are often used.
Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009      25
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        The usual I/O devices present in desktop computer systems are often
        not present in embedded systems, e.g., keyboard, mouse, video
        display.
        How do you develop and debug real-time
        embedded software?
              You're not going to use printf() unless you
              have some display device attached to a
              serial port perhaps. However, you may
              light up some LED's.
              Another trick is to assert an output pin and
              monitor it with an oscilloscope. Multiple
              outputs can be used to measure timing.
              A logic analyzer[9] is an electronic
              instrument which will capture and
              display digital signals. You can think
              of it as sorta a fancy oscilloscope.


Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   26
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        How do you develop and debug real-time embedded software?
              A simulation is a not-necessarily-exact replication of something, e.g., flight
              simulator. All or part of the embedded system can be simulated on a
              workstation, and programmers can develop and debug software in that
              environment.
              Emulators. From Wikipedia[5]: "An emulator duplicates (provides an
              emulation of) the functions of one system using a different system, so that
              the second system behaves like (and appears to be) the first system. This
              focus on exact reproduction of external behavior is in contrast to some
              other forms of computer simulation, which can concern an abstract model
              of the system being simulated."
              E.g, the Java Virtual Machine emulates a hypothetical 32-bit stack-based
              computer system--that does not exist in the real world.
              E.g., emulators for old microcomputers, e.g., Commodore 64, PDP-1.




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009           27
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        How do you develop and debug real-time embedded software?
              An emulator can run entirely in software or be implemented in hardware.
              Software emulation is, in general, slower than hardware emulation and is
              really not that much different than simulation.
              A hardware emulator uses real hardware to emulate the other system. For
              example, consider an embedded system using an 8051 microprocessor.
              The emulator will contain a physical 8051 chip (often a special version of
              the chip which has additional debug capabilities built into it).
              The most powerful form of hardware emulators in embedded systems
              development are in-circuit emulators[2] (ICE's).




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009       28
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        How do you develop and debug real-time embedded software?

              iSYSTEM 8-bit ICE with
              interchangeable pods and
              winIDEA IDE




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   29
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        How do you develop and debug real-time embedded software?
              ICE's
                    The microprocessor in the ICE plugs into the circuit where the real
                    embedded microprocessor would be. The IDE on the host system is
                    used to control the ICE microprocessor. The programmer can view the
                    contents of registers, memory, set breakpoints, etc. to debug the
                    program.
                    The ICE allows the system to be debugged while running at full speed.
                    It will allow a trace of the program statements that were executed to
                    be collected for post-run analysis. Because embedded systems are
                    often real-time systems, being able to run the system at full-speed
                    and collecting a trace is a very powerful way to debug.
                    ICE's tend to be very pricey.
              In-circuit debuggers (ICD's)
                    Some microcontrollers have special debug circuitry built into them. A
                    hardware device can plug into the debug port on these chips and allow
                    the programmer to debug the system on a host computer.
                    Motorola/Freescale calls their technology Background Debug Mode[6]
                    (BDM).

Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009        30
    Intro to Embedded Systems: Embedded Systems Characteristics

  Design and Development (continued)
        How do you develop and debug real-time embedded software?
              In-circuit debuggers (ICD's)
                    An ICD is the setup we have in the BY lab connecting the host
                    computer system to the Freescale ColdFire MCF5211 development
                    board.
                    The host computer runs the CodeWarrior IDE 5.7 to facilitate
                    development, testing, and debugging.




Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009   31
                               Intro to Embedded Systems: References
Much of the material in this set of slides was borrowed from the following sources:

1. James Hamblen
    users.ece.gatech.edu/~hamblen
    users.ece.gatech.edu/~hamblen/wemap/CDROM_IMAGE/PPT/
2. Wikipedia: In-circuit emulator.
    http://en.wikipedia.org/wiki/In-circuit_emulator
3. Wikipedia: Microcontrollers
    en.wikipedia.org/wiki/Microcontroller
4. Wikipedia: Real-time processing.
    en.wikipedia.org/wiki/Real_time
5. Wikipedia: Emulator.
    en.wikipedia.org/wiki/Emulator
6. Freescale BDM for HCS08
    http://www.freescale.com/files/microcontrollers/doc/app_note/AN3335.pdf
7. Beginner's Corner - In-Circuit Emulators
    http://www.ganssle.com/articles/BegincornerICE.htm
8. Wikiepedia: Logic Analyzer
    http://en.wikipedia.org/wiki/Logic_analyzer
9. Field-Programmable Gate Arrays
    http://en.wikipedia.org/wiki/Fpga
10. Douglas Wenstrand and Joseph Haber (link is no longer active, but it is only fair to give credit)
    www.echelonembedded.com/dsphwlab/notes/class1.ppt




 Kevin R Burger~ Dept. of CS & Engineering ~ Arizona State University ~ (c) 2008-2009                   32

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:18
posted:7/29/2011
language:English
pages:32