2) MICROCONTROLLERS AND EMBEDDED PROCESSORS



2.1) What is a Microcontroller?


    A controller is used to control (makes sense!) some process or aspect
    of the environment.  A typical microcontroller application is the
    monitoring of my house.  As the temperature rises, the controller
    causes the windows to open.  If the temperature goes above a certain
    threshold, the air conditioner is activated.  If the system detects
    my mother-in-law approaching, the doors are locked and the windows
    barred.  In addition, upon detecting that my computer is turned on,
    the stereo turns on at a deafening volume (for more on this, see the
    section on development tools).

    At one time, controllers were built exclusively from logic
    components, and were usually large, heavy boxes (before this, they
    were even bigger, more complex analog monstrosities).  Later on,
    microprocessors were used and the entire controller could fit on a
    small circuit board.  This is still common - you can find many [good]
    controllers powered by one of the many common microprocessors
    (including Zilog Z80, Intel 8088, Motorola 6809, and others).

    As the process of miniaturization continued, all of the components
    needed for a controller were built right onto one chip.  A one chip
    computer, or microcontroller was born.  A microcontroller is a highly
    integrated chip which includes, on one chip, all or most of the parts
    needed for a controller.  The microcontroller could be called a
    "one-chip solution".  It typically includes:
          CPU (central processing unit)
          RAM (Random Access Memory)
          EPROM/PROM/ROM (Erasable Programmable Read Only Memory)
          I/O (input/output) - serial and parallel
          timers
          interrupt controller

    By only including the features specific to the task (control), cost
    is relatively low.  A typical microcontroller has bit manipulation
    instructions, easy and direct access to I/O (input/output), and quick
    and efficient interrupt processing.  Microcontrollers are a "one-chip
    solution" which drastically reduces parts count and design costs.


2.2) What is an embedded controller?


    Hah!  Why not ask an easy question like "Did Adam have a navel?" or
    "Did Eve?"  

    Simply (and naively stated) an embedded controller is a controller
    that is embedded in a greater system.  A rigid definition is
    difficult if not impossible to formulate, since the usual response is
    "most embedded controllers are...".  The problem here is "most".  We
    can't seem to shake that word from the definition.  No matter how
    clever you feel your definition is, some wiseguy will come along and
    find an exception, or two, or 50.

    You COULD say that an embedded controller is a controller (or
    computer) that is embedded into some device for some purpose other
    than to provide general purpose computing.  Of course, someone will
    eventually prove you wrong, but who cares?

    A common example of a general purpose computer, would be a typical PC
    clone.  The x86 processor in this machine can't really be considered
    an embedded controller, since the machine is typically used for
    general purpose computing.  However, what is general purpose
    computing?  Take this same PC clone, turn it into a multi-media
    machine, and voila!  You have an appliance - much on the order of a
    microwave oven or television.  Is the x86 processor now considered an
    embedded controller  Or, is the PC clone itself now considered an
    embedded controller, controlling the multi-media peripherals?  Hey -
    I don't know about you, but I'm getting too old for this nonsense.

    Is a microcontroller an embedded processor?  Is an embedded processor
    a microcontroller?  What's the difference between an embedded
    processor and a microcontroller?  Well, today - not much.  With the
    continuing process of high scale integration continuing at a dizzying
    pace, many standard architecture processors are turning up as
    microcontrollers.  A few such examples are the Motorola 68EC300,
    Intel 386 EX, and the IBM PowerPC 403GB.  These chips could be called
    super-microcontrollers.

    So, what's the difference between an embedded processor and a
    microcontroller?  I wouldn't touch that question with a ten foot
    logic probe.

    We might be safe by stating that an embedded processor controls
    something (for example controlling a device such as a microwave oven,
    car braking system, or a cruise missile).  Is this always true?
    Maybe.  Maybe not.  You know, it just doesn't end.

    The main thing is not to get to hung up on precise definitions.
    Black and white?  Hell no, we've got grey scale, dithering,
    diffusion, you name it!  Same thing goes here with embedded
    controllers, just go with the flow.  It all depends on your point of
    view.

    Alright, if you really must insist, we'll take a stab at defining
    what an embedded controller is - realize however that there will be
    many exceptions.  Embedded controllers adhere to a philosophy similar
    to that of microcontrollers, high integration.  By including [many]
    features necessary for the task at hand, an embedded controller
    (processor) can be a powerful yet cost effective solution.  However,
    where a microcontroller [almost by definition] is a computer on a
    chip, an embedded controller might need external components before it
    is considered a "computer."  This is especially true regarding RAM.
    Since including large amounts of RAM (megabytes) on a processor is
    not really practical (due to cost and available silicon real estate)
    and because many embedded controllers are real powerhouses requiring
    large amounts of RAM, the RAM is often external to the processor.


2.3) Applications


    In addition to the above home monitoring system, embedded processors
    and microcontrollers are frequently found in: appliances (microwave
    oven, refrigerators, television and VCRs, stereos), computers and
    computer equipment (laser printers, modems, disk drives), automobiles
    (engine control, diagnostics, climate control), environmental control
    (greenhouse, factory, home), instrumentation, aerospace, and
    thousands of other uses.  In many items, more than one processor can
    be found.

    Microcontrollers are typically used where processing power isn't so
    important.  Although some of you out there might find a microwave
    oven controlled by a Unix system an attractive idea, controlling a
    microwave oven is easily accomplished with the smallest of
    microcontrollers.  On the other hand, if you're putting together a
    cruise missile to solve the problem of your neighbor's dog barking at
    3 in the morning, you'll probably need to use processors with a bit
    more computing power.

    Embedded processors and microcontrollers are used extensively in
    robotics.  In this application, many specific tasks might be
    distributed among a large number of controllers in one system.
    Communications between each controller and a central, possibly more
    powerful controller (or micro/mini/mainframe) would enable
    information to be processed by the central computer, or to be passed
    around to other controllers in the system.

    A special application that microcontrollers are well suited for is
    data logging.  Stick one of these chips out in the middle of a corn
    field or up in a ballon, and monitor and record environmental
    parameters (temperature, humidity, rain, etc).  Small size, low power
    consumption, and flexibility make these devices ideal for unattended
    data monitoring and recording.


2.4) Flavors


    Embedded processors come in many flavors and varieties.  Depending on
    the power and features that are needed, you might choose a 4, 8, 16,
    or 32 bit microcontroller.  Standard microprocessors (such as the
    Motorola 68000 or National 32032) are frequently used as powerful
    embedded controllers.  In addition, specialized processors are
    available which include features specific for communications,
    keyboard handling, signal processing, video processing, and other
    tasks.