You are on page 1of 7

1

Course: EE529 Embedded Systems


Fall 2015, Institute of Electronics and Electrical Engineering (IGEE), Boumerdes

Course Objectives: This module introduces students into the software/hardware aspects for embedded systems. This
module builds on the already accumulated knowledge from the Advanced Digital Systems Design, Microprocessor Systems
Design, and Computer Architecture courses. As an outcome, students should be able to design and implement embedded
systems based on both microcontrollers and FPGAs (SoPC).

Lecturer: Dr A. MAACHE

Course Outline:
Part I Introduction to Embedded Systems: - General Definitions, - Real-time Embedded Systems
Part II Microcontroller Systems Design using 68HC12: - Architecture, - Assembly/C Programming, - I/O Interfacing
Part III FPGA based Embedded Systems (System on Programmable Chip SoPC): - Hardware design using SoPC
based on Altera’s Nios II processor, - Software Programming

Textbooks:
- HCS12/9S12: An Introduction to Software and Hardware Interfacing, Second Edition, 2009, Han-Way Huang.
- Embedded SOPC Design with NIOS II Processor and VHDL Examples, 2011, Pong P. Chu.
Chapter 1

Introduction to Embedded Systems

1.1 Basic Organisation of a Computer System

A basic Computer System contains four components: microprocessor unit (Central Processing Unit CPU), memory (data
and program), input/output (I/O), and interconnection structure (buses). The µP is the master and the other peripherals
are slaves, in which it controls and initiates all operations. These components are connected using buses (data, address, and
I/O). There are two main types of architectures:

Von-Neumann’s Architecture:
- Von-Neumann is credited with developing the idea of controlling the operation of hardware through the manipulation of
control signals. In other words, we use software (program) to control hardware.
- The memory of the computer is used to store the sequence of the control signal manipulations (program) required to
perform a task = software programming
- This architecture has been the basis for virtually all computer designs since the first generation
- Both Data and Instructions (control sequences) are stored in a single read-write memory (RAM)
- Memory contents are addressable by location regardless the type of data contained there (data and programs look the same)
- Execution occurs in a sequential fashion by reading consecutive instructions from memory

Harvard Architecture is based on separates program/data memories.


2
Chapter 1 Introduction to Embedded Systems 3

1.2 Performance of Microprocessors

The basic characteristics of µP include:


- Instruction Set: the set of instructions that can be executed.
- Clock Speed(MHz): it determines how many instructions per second the processor can execute.

1.3 Complex Instruction Set Computer (CISC) Processor

In the 1970s, motivation was to try and reduce the program size as memory was limited and most programs were written
using low-level languages.

• Variable-length instructions to save program memory


• Control logic complex in order to support complex instructions
• Use of micro-code (one program instruction can execute in many cycles)
• Small internal register sets
• Binary compatibility (old binary code can run on newer versions)
• Use of complex addressing modes For example, operands can reside in external memory or internal registers

1.4 Reduced Instruction Set Computer (RISC) Processor

In the 1980s, the RISC philosophy was proposed. By having simpler instructions, the processors complexity could be reduced.
Also noticed that complex instructions were rarely used by compilers and often less efficient.

• Instructions of fixed length executing in a single clock cycle


• Pipelines are used to achieve one-instruction-per-one-clock-cycle
• Simple control logic increases clock speed
• Operations performed on internal registers only. Only LOAD and STORE instructions access external memory. This is
often termed a load-store architecture

Many 8/16-bit CPUs or microcontrollers are the basis of today’s embedded systems. An embedded system is a computer
system designed for specific control functions within a larger system, often with real-time computing constraints.

1.5 What is the difference between microprocessor and microcontroller?

- A microcontroller is a complete computer on a single chip, i.e. A microprocessor with peripherals, program and data
memory. They are mostly RISC processors based on the Harvard architecture. Microcontrollers are used in sequential logic
designs, rather than as heavy computation computer engines. Examples of microcontrollers include: Intel 8051, Microchip
PIC, Atmel AVR, Texas Instruments MSP430. The figure bellow shows a typical architecture of a microcontroller with three
I/O ports, ADC, Serial Port, RAM, ROM, Timer. Microcontrollers usually must have low-power requirements ( . 05 - 1 W
as opposed to 10 - 50 W for general purpose desktop CPUs) since many devices they control are battery-operated.
4 Chapter 1 Introduction to Embedded Systems

1.6 What is an Embedded System?

An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, of-
ten with real-time computing constraints. By contrast, a general-purpose computer, such as a personal computer (PC), is
designed to be flexible and to meet a wide range of end-user needs.

Modern embedded systems are often based on microcontrollers but ordinary microprocessors are also used especially in
more complex systems. Application Specific Integrated Circuits (ASIC), FPGAs, Digital Signal Processors (DSPs) are also
common class of dedicated processors used in embedded systems.

The key characteristic, however, is being dedicated to handle a particular task. Hence, design engineers can optimize it
to reduce the size and cost of the product and increase the reliability and performance.

Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary
installations like traffic lights, factory controllers. Complexity varies from a single microcontroller chip, to multiple units,
peripherals and networks.

1.7 Examples of Embedded Systems:

Consumer electronics include mp3 players, mobile phones, videogame consoles, digital cameras, DVD players, and print-
ers. Household appliances, such as microwave ovens and washing machines include embedded systems to provide flexibility
and efficiency. Home automation uses wired- and wireless-networking that can be used to control lights, climate, security,
audio/visual, surveillance, etc.

Telecommunications systems employ numerous embedded systems such as telephone switches, network routers, mobile
phones, etc.

Transportation systems from Airplanes to cars increasingly use embedded systems such as GPS receivers and motor
controllers. Other automotive safety systems include anti-lock braking system (ABS) and Airbags.

Wireless sensor networking, WSN, makes use of sophisticated tiny sensors to enable people to measure a number of things
in the physical world and act on this information through IT monitoring and control systems. These WSN are completely
self-contained, and will typically run off a battery source for years before the batteries need to be changed or charged.

IPhone:
Chapter 1 Introduction to Embedded Systems 5

ADSL router:

The figure shows the internals of a Netgear DG632 ADSL modem/router. It acts as a router between an ethernet port
and an ADSL broadband internet connection. A modern example of an embedded system. Labelled parts include a micro-
processor (4), RAM (6), and flash memory (7).

The labelled parts are as follows:


1. Telephone decoupling electronics (for ADSL).
2. Multicolour LED (displaying network status).
3. Single colour LED (displaying USB status).
4. Main processor, a TNETD7300GDU, a member of Texas Instruments’ AR7 product line.
5. JTAG (Joint Test Action Group) test and programming port.
6. RAM, a single ESMT M12L64164A 8 MB chip.
7. Flash memory, obscured by sticker.
8. Power supply regulator.
9. Main power supply fuse. 10. Power connector. 11. Reset button.
12. Quartz crystal. 13. Ethernet port.
14. Ethernet transformer, Delta LF8505.
15. KS8721B ethernet PHY transmitter receiver. 16. USB port.
17. Telephone (RJ11) port. 18. Telephone connector fuses.
6 Chapter 1 Introduction to Embedded Systems
1.8 Characteristics

- Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks.

- Some also have real-time performance constraints that must be met, for reasons such as safety and usability; others may
have low or no performance requirements, allowing the system hardware to be simplified to reduce costs.

- Embedded systems are not always standalone devices. Many embedded systems consist of small, computerized parts
within a larger device that serves a more general purpose.

- The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory
or Flash memory chips. They run with limited computer hardware resources: little memory, small or non-existent keyboard
or screen.

- In many embedded applications the only programming occurs in connection with the initial loading of the application
code or a later software upgrade of that application.

- In many embedded applications, we need to minimize memory used and the power consumed (extend battery life). The
memory can be a substantial portion of the system cost, and it is important to optimize memory size in such cases.

1.8.1 Real-Time Processing

Often, the performance requirement in an embedded application is a real-time requirement. A real-time performance re-
quirement is one where a segment of the application has an absolute maximum execution time that is allowed. For example,
in a digital set-top box the time to process each video frame is limited, since the processor must accept and process the
frame before the next frame arrives (typically called hard real-time systems). In some applications, a more sophisticated
requirement exists: The average time for a particular task is constrained as well as is the number of instances when some
maximum time is exceeded. Such approaches (typically called soft real-time) arise when it is possible to occasionally miss
the time constraint on an event, as long as not too many are missed.

1.8.2 User Interface

Embedded systems range from no user interface at all, in systems dedicated only to one task, to complex graphical user
interfaces that resemble modern computer desktop operating systems. Simple embedded devices use buttons, LEDs, graphic
or character LCDs with a simple menu system. Discrete I/O or General Purpose Input/Output (GPIO) are used to interface
digital systems whereas Analog to Digital/Digital to Analog (ADC/DAC) are used to interface with analogue signals.

More sophisticated devices which use a graphical screen with touch sensing or screen-edge buttons provide flexibility while
minimizing space used.

Some systems provide user interface remotely with the help of a serial (e.g. RS-232, USB, I2C, etc.) or network (e.g.
Ethernet) connection.

1.8.3 Processors in embedded systems

Embedded processors can be broken into two broad categories: Ordinary microprocessors (µP) use separate integrated cir-
cuits for memory and peripherals. Microcontrollers (µC) have on-chip peripherals, thus reducing power consumption, size
and cost. In contrast to the personal computer market, many different basic CPU architectures are used, since software is
custom-developed for an application and is not a commodity product installed by the end user.

Both Von Neumann as well as various degrees of Harvard architectures are used. RISC as well as non-RISC processors are
found. Word lengths vary from 4-bit to 64-bits and beyond, although the most typical remain 8/16-bit. Other processing
chips can be used in embedded systems such as: FPGAs, ASICs, and DSPs.
Chapter 1 Introduction to Embedded Systems 7
1.8.4 Real-Time Operating Systems RTOS

It is common for organizations to use a real-time operating system (RTOS), allowing the application programmers to concen-
trate on device functionality rather than operating system services, at least for large systems; smaller systems often cannot
afford the overhead associated with a generic real time system, due to limitations regarding memory size, performance, or
battery life.

1.8.5 Reliability

Embedded systems often reside in machines that are expected to run continuously for years without errors, and in some
cases recover by themselves if an error occurs. Therefore the software is usually developed and tested more carefully than
that for personal computers, and unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.
Some systems must be kept running for safety, security, and cost reasons such as space systems, reactor control systems, un-
dersea cables, train signals, funds transfer, etc. A variety of techniques are used to recover from errors (software, hardware).
A Watchdog timer is used to reset the computer unless the software periodically notifies the watchdog. Subsystems with
redundant spares are used that can be switched over to.

You might also like