Embedded System Module 1
Embedded System Module 1
I. Small scale embedded systems: These systems are designed with a single 8 or 16-bit
microcontroller: they have little hardware and software complexties and involebrd-evel
design.They may even be battery operated. When developing embedded software for these an
editor assembler and cross assembler an integrated development environment (ISE) tool
specific to the microcontroller or processor used are the main programming tools. Using C
language programs are compiled into the assembly and executable codes are appropriately
located in the system memory. The software has to fit within the memory available and keep
in view the need to limit power dissipation when the system is running continuously.
2. Medium scale embedded systems: These systems arealy designed with a single or a few 16
or 32-bit microcontrollers, DSPs or RISCs. These systems may also employ the readily
available single purpose processors and IPs (explained later) for the various functions for
example, bus interfacing. [ASSPs and IPs may also have to be appropriately configured by
the system software before being integrated into the system-bus.] Medium scale embedded
systems have both hardware and software complexities. For complex software design, the
following programming tools are available: C/C++/Visual C++/Java, RTOS, source code
engineering tool, simulator, debugger and an integrated development environment. Software
tools also provide solutions to hardware complexities.
An embedded system designer has to develop a product using the available tools within the
given specifications, cost and time frame.
1. Skills for Small Scale Embedded System Designer: Author Tim Wilmshurst in his book
states that the following skills are needed in the individual or team that is developing a small
scale system: "Full understanding of microcontrollers with a basic knowledge of computer
architecture, digital electronic design, software engineering, data communication, control
engineering, motors and actuators, sensors and measurements, analog electronic design and
IC design and manufacture" Specific skills will be needed in specific situations. For example,
control engineering knowledge will be needed for design of control systems, and analog
electronic design knowledge will be needed when designing the system interfaces. The basic
aspects of the following topics will be described in this book to prepare the designer who
already has a good knowledge of the microprocessor or microcontroller to be used. (1)
Computer architecture and organization. (2) Memories. (3) Memory allocation (4) Interfacing
memories. (5) Burning (a term used for porting) to executable machine codes in PROM or
ROM. (v) Use of decodes and de multiplexers. (6) Direct memory accesses. (7) Ports. (8)
Device drivers in assembly. (9) Simple and sophisticated buses. (10) Timers. (11) Interrupt
servicing mechanism. (12) C programming elements. (13)Memory optimization, (14)
Selection of hardware and microcontroller (15) Use of In-Circuit –Emulators (ICE) cross-
assemblers and testing equipment (xvi) Debugging the software and hardware bugs by using
test vectors. Basic knowledge in other areas-software engineering, data communication,
control engineering, motors and actuators, sensors and measurements, analog electronic
design and IC design and manufacture can be obtained from the standard text books
available. A designer interested in small-scale embedded systems may not need at all
concepts of interrupt latencies and deadlines and their handling, the RTOS programming
tools described in Chapters 9 and 10 and the program models given in Chapter 6.
3. Skills for Sophisticated Embedded System Designer: A team is needed to co-design and
solve the high level complexities of hardware and software design. Embedded system
hardware engineers should have skills in hardware units and basic knowledge of 'C/C++ and
Java, RTOS and other programming tools. Software engineers should have basic knowledge
in hardware and a thorough knowledge of C, RTOS and other programming tools. A final
optimum design solution is then obtained by system integration.
A processor has two essential units: Program Flow Control Unit (CU) and Execution Unit
(EU). The EU has circuits that implement the instructions pertaining to data transfer
operations and data conversion from one form to another. The EU include the Arithmetic and
Logical Unit (ALU) and also the circuits that execute instructions for a program control task,
say, halt, interrupt, or jump to another set of instructions. It can also execute instructions for a
call or branch to another program and for a call to a function.
A processor runs the cycles of fetch-and-execute. The instructions, defined in the processor
instructions set, are executed in the sequence that they are fetched from the memory. A
processor is in the form of an IC chip; alternatively, it could be in core in an Application
Specific Integrated Circuit (ASIC) or System on Chip (SoC). Core means a part of the
functional circuit on the Very Large Scale Integrated (VLSI) chip.
An embedded system processor chip or core can one of the following.
1. General Purpose Processor (GPP): A GPP is a general-purpose processor with
instruction set designed not specific the applications.
(a) Microprocessor
(b) Embedded Processor
2. Application Specific Instruction-Set Processor (ASIP). An ASIP is a processor with
an instruction set designed for specific application on a VLSI chip.
(a) Microcontroller
(b) Embedded microcontroller
(c) Digital Signal Processor (DSP) and media processor
(d) Network processor, IO processor or domain-specific programmable processor
3. Single Purpose Processors as additional processors: Single purpose processor
examples are as follows:
(a) Coprocessor (e.g., as used for graphic processing, floating point processing,
encrypting, deciphering, discrete cosine transformation and inverse transformation or
TCP/IP protocol stacking and network connecting functions).
(b) Accelerator (e.g., Java codes accelerator).
(c) Controllers (e.g., for peripherals, direct memory accesses and buses).
4. GPP or ASIP cores integrated into either an ASIC or a VLSI circuit or a Field
Programmable Gate Array (FPGA) core integrated with processor units in VLSI
(ASIC) chip.
5. Application Specific System Processor (ASSP)
6. Multicore processors or multiprocessor
For a system designer, the following are important considerations when selecting a processor:
1. Instruction set
2. Maximum bits in an operand (8 or 16 or 32) in a single arithmetic or logic operation
3. Clock frequency in MHz and processing speed in Million Instructions Per Second
(MIPS) or in an alternate metric Dhrystone for measuring processing performance
4. Processor ability to solve complex algorithms while meeting deadlines for their
processing.
A microprocessor or GPP is used because: (i) processing based on the instructions available
in a predefined general purpose instruction set results in quick system development. (ii) Once
the board and I/O interfaces are designed for a GPP, these can be used for a new system by
just changing the embedded software in the ROM. (iii) Ready availability of a computer
facilitates embedded software development in high-level languages. (iv) Ready availability of
well-tested and debugged processor-specific APIs (Application Program Interfaces) and
codes previously designed for other applications results in new systems developed quickly.
2. Microprocessor
The CPU is a unit that centrally fetches and processors a set of general-purpose instructions.
The CPU instruction set includes for data transfer operations, ALU operations, stack
operations, IO operations and program control, sequencing and supervising operations. The
general-purpose instruction set is always specific to a specific CPU. Any CPU must possess
the following basic functional units:
1. A control unit that fetches and controls the sequential processing of a given command
or instruction and communicates with the rest of the system.
2. An ALU that undertakes arithmetic and logical operations on byes or words. It may
be capable of processing 8, 16, 32 or 64-bit words at an instant.
A microprocessor is a single VLSI chip that has a CPU and may also have some other units
(e.g., caches, floating point processing arithmetic unit, pipelining and superscaling units) that
are additionally present and that result in faster processing of instructions.
The earlier generation microprocessor’s fetch-and-execute cycle was guided by a clock
frequency of the order of ~4 MHz. Processors now operate at a clock frequency of 4 GHz and
even have multiple cores. In early 2002, it became possible to design Gbps (Giga bit per
second) transceiver and encryption engines in a few highly sophisticated embedded systems
using processors that operate on GHz frequencies. A transceiver is a transmitting cum
receiving circuit that has appropriate processing and control units, for example, for
controlling bus-collisions. An encryption engine is a system that encrypts the data to be
transmitted on the network.
Intel 80x86 (also referred as x86) processors are the 32-bit successors of 8086. [The x refers
to an 8086 extended for 32 bits.] Examples of 32-bit processors in 80x86 series are Intel
80386, 80486 and Pentiums ( a new generation of 32- and 64-bit microprocessors is the
classic Pentium series). IBM PCs use 80x86 series and the embedded systems incorporated
inside the PC for specific tasks (like graphic accelerator, disk controllers, network interface
card) use these microprocessors.
High performance processors have pipeline and superscalar architecture, fast ALUs and
Floating Point Processing Units (FLPUs). [A pipeline architecture means that the instructions
have between 3 and 9 stages. Different instructions are at different stages of the pipeline at
any given instance. A superscalar architecture refers to two or more sets of instructions
executing in parallel pipelines.]
The important microprocessors used as general-purpose processor when large embedded
software has to be located in the external memory chips.
3. Microcontroller
A microcontroller is an integrated chip that has processor, memory and several other
hardware units in it; these form the microcomputer part of the embedded system. Figure 1.2
shows the functional circuits present (in solid boundary boxes) in a microcontroller. It also
shows the application-specific units (in dashed boundary boxes) in a specific version of a
given microcontroller family.
Just as microprocessor is the most essential part of a computing system, a microcontroller is
the most essential component of a control or communication circuit. A microcontroller is a
single-chip VLSI unit (also called ‘microcomputer’) which though have limited
computational capabilities, possesses enhanced input-output capabilities and a number of on-
chip functional units. Microcontrollers are particularly suited for use in embedded systems
for real-time control applications with on-chip program memory and devices.
A few of the latest microcontrollers also have dual core and high computational and
superscalar processing capabilities. Important microcontroller chips for embedded systems
are 8051, 8051MX, 68HC11x, HC12xx, HC16xx,PIC 16F84 or 16C76, 16F876 and PIC18,
microcontroller enhancements of ARM9/ARM7 from ARM, Intel, Philips, Samsung and ST
microelectronics.
Fig. 1.2 Various functional circuits (solid boundary boxes) in a microcontroller chip or core
in an embedded system. Also shown are the application-specific units (dashed boundary
boxes) in a specific version of a microcontroller
Figure 1.3 shows commonly used microcontrollers in small-, medium- and large-scale
embedded systems. Choosing a microcontroller as a processing unit depends upon the
application-specific features in it.
A microcontroller is used when a small or part of the embedded software has to be located in
the internal memory and when on-chip functional units such as the interrupt-handler, port,
timer, ADC, PMW and CAN controller are required.
Single purpose processors are used for specific applications or computations or as controllers
for peripherals, direct memory accesses and buses.
1)POWER SOURCE
•Most of the systems have their own power supply.
•ES operates in one of the power ranges
•5.0V, + 0.25v , 3.3V, 2.0V+ 0.2V, 15V+0.2V.
•5V system is used in most systems.
•In a low-performance system, CMOS is used which is of 0.2V.
•The dissipation reduces by 1/6.
•P=V2/R , PCMOS/PV =22/R/52/R=4/25≈1/6.
2)CLOCK OSCILLATOR
•Clock controls time for executing an instruction.
•CPU maintains clock using an oscillator.
•This generates a periodic oscillating electronic signal.
•Crystal oscillators are used in most cases.
4)MEMORY
•ROM OR EEPROM: Stores application programs from where the processor fetches
instructions codes for s/m booting, initialization, pointers, ISR.
•RAM(internal and external Ram for buffer: Storing variables during program run and storing
the stack, storing input output buffers.
•Memory Stick(OR Card): it is used to store high definition video, images etc.
•EEPROM or Flash : storing nonvolatile results for processing.
•Cache: storing copies of instructions and data in advance and storing their results
temporarily.
5)DAC USING A PWM AND AN ADC
•DAC is a circuit that converts 8,10,12 bits to analog output.
•DAC operation is done with the help of a combination of PWM in the microcontroller and
an
external integrator chip.
•PWM inputs are from 00000000 to 11111111 for an 8-Bit DAC operation.
•The equation for obtaining analog output V= K*PW
•Where,K= constant.
PW= pulse Width and it is made proportional to analog output needed.
•ADC is a circuit that converts analog input to digital.
•The applications of ADC are Data acquisition, digital cameras, Voice digitizing systems.
•Eg. Suppose a system gets analog i/p’s from sensors of temperature, pressure, heartbeats
etc., this analog information has to be converted to digital in the form of bits for the further
Processing
7)KEYPAD/KEYBOARD
•The KEYPAD/KEYBOARD is used for getting user inputs.
•The keypad has a maximum of 32 keys.
•The keyboard has a maximum of 104 keys or more.
•The keypad or keyboard may interface serially or parallelly to the processor directly through
the ports or through the controller.
9)INTERRUPT HANDLER
•An interrupt handling mechanism is required in each system to handle interrupt's from
various processes and for handling multiple interrupts waiting for service.
•If multiple interrupts are occurring simultaneously the system prioritizes the sources of
interrupts and service them accordingly.
•Some interrupt sources are maskable some interrupt sources cannot be masked.
Q6) Explain:-
(a) Process of converting assembly language into machine code
(b) Process of converting C-program into file for ROM image
Ans- A compiler takes the program code (source code) and converts the source code to a
machine language module (called an object file). Another specialized program, called a
linker, combines this object file with other previously compiled object files (in particular run-
time modules) to create an executable file. So, for a compiled language the conversion from
source code to machine executable code takes place before the program is run. This is a very
different process from what takes place for an interpreted programming language.
This is somewhat simplified as many modern programs that are created using compiled
languages makes use of dynamic linked libraries or shared libraries. Therefore, the executable
file may require these dynamic linked libraries (Windows) or shared libraries (Linux, Unix)
to run.
When build tools run on the same system as the program they produce, they can make a lot of
assumptions about the system. This is typically not the case in embedded software
development, where the build tools run on a host computer that differs from
the target hardware platform. There are a lot of things that software development tools can do
automatically when the target platform is well defined. This automation is possible because
the tools can exploit features of the hardware and operating system on which your program
will execute. For example, if all of your programs will be executed on IBM-compatible PCs
running Windows, your compiler can automate—and, therefore, hide from your view—
certain aspects of the software build process. Embedded software development tools, on the
other hand, can rarely make assumptions about the target platform. Instead, the user must
provide some of her own knowledge of the system to the tools by giving them more explicit
instructions.
7. USER INTERFACE DESIGN : User interface design is an important part of design. User
interfaces are designed as per the requirements, analysis of the environment and system
functions. For example, in an automatic chocolate vending machine (ACVM) system, the
user interface is an LCD multiline graphics display. It can display a welcome message as well
as specify the coins needed to be inserted into the machine for each type of chocolate. The
same ACVM may be designed with touchscreen User Interface (GUI), or it may be designed
with Voice User Interfaces (VUIs). Any of these interface designs has to be validated by the
customer. For example, the ACVM customer who installs the machine must validate message
language and messages to be displayed before an interface design can proceed to the
implementation stage.
8. REFINEMENTS : Each component and module design needs to be refined iteratively till it
becomes the most appropriate for implementation be the software team. Figure shows the
activities for software-design cycle during an embedded software development process and
the cycle may be repeated till tests show the verification of specifications.
Specification: Clear specification of the required system are must. Specification need
to be precise. Specification guide customer expectations from the product. They also
guide system architecture. They designer needs specification for
i. Hardware, for example, peripherals, devices processor and memory
specifications,
ii. Data types and processing specifications,
iii. Expected system behavior specifications,
iv. Constraints of design, and
v. Expected life cycle specifications.
Process specifications are analysed by making lists of outputs and events, output on
events and how the processes activate on each event(interrupt).
Architecture: Data modeling design of attributes of data structure, data flow graphs,
program models, software architecture layers and hardware architecture are defined.
Software architectural are as follows:
1) The first layer is an architectural design. Here, a design for system architecture
is developed. The question arises as to how the different elements- data
structures, databases, algorithms, control functions, state transition functions,
process, data and program flow-are to be organized.
2) The second layer consist of data-design. Questions at this stage are as follows.
What design of data structures and databases would be most appropriate for the
given problem? Whether data organized as a tree- like structure will be
appropriate? What will be the design of components in the data? [for example,
video information we have to components, image and sound.]
3) The third layer consist of interface design. Important questions at this stage are
as follows. What shall be the interface to integrate the components? What is the
design for system integration? What shall be design of interfaces used for taking
inputs from the data objects, structures and databases and for delivering
outputs? What will be the port structure for receiving inputs and transmitting
outputs?
Components: The fourth layer is a component level design. The question at this stage
is as follows. What shall be the design of each component? There is an additional
requirement in the design of embedded systems, what each component should be
optimized for memory usage and power dissipation. Components of hardware,
processes, interfaces and algorithms. The following lists the common hardware
components:
1) Processor, ASIP and single purpose processors in the system
2) Memory RAM, ROM are internal and external to the system flash or secondary
memory in the system
3) Peripherals and devices internal and external the system
4) Ports and buses in the system
5) Power source or battery in the system
During software development process we can model the components as object-
oriented.
Components-based object-oriented software development process
Effort Activities Model Deficiency
Stage 1 Components that could
be used in software
development identified
Stage 2 Selection of available
classes(single logically
bonded groups) from a
software components
resource library
Stage3 Sort components, which Need for robust
are available and interfaces and slow
reusable by re- development in case the
engineering and which reusable components are
are available not available in required
numbers
Stage4 Re-engineer components
and create unavailable
components
Stage5 Construct software from
the components and test
them
Stage6 Iteratively construct till
final validation of
software
System integration: Built components are integrated in the system. Components may
work fine independently, but when integrated may not fullfil the design metrics. The
system is made to function and validated. Appropriate testes are chosen. Debugging
tools are used to correct erroneous functioning. Each component and its interface
system is integrated after the design stage. Program implementation is in a language
and may use an integrated development environment(IDE), and source code
engineering tools, which should follow the model, software architecture and design
specifications. Program simplicity should be maintained during the implementation
process.
Q9) What are the design metrics used in Embedded System? Explain the
challenges faced in designing an Embedded System?
Ans- Design metrics used in the embedded system
Design metrics Description
Power Dissipation For many systems, particularly battery operated systems ,such as
mobile phone or digital camera the power consumed by the
system is an important feature. The battery needs to be
recharged less frequently if power dissipation is small.
Performance Instructions execution time in the system measures the
performance. Smaller execution time means higher performance.
Process deadlines There are number of processes in the system, for example,
keyboard input processing, graphic display refresh. These have
deadlines within which each of them may be required to finish
computation and give results
System and user safety System safety in terms of accidental fall from hand or table, theft
and in terms of user safety when using a product
5.Modular design
System designing is decomposition of hardware and software modules.
*Smart Card H/w Modules are as follows;
Microcontroller-based h/w, Charge pump for supply, Modulator for signal transmission, and
Antenna for transceiver.
*Smart Card S/W modules are as follows:
RTOS and Application software
6.MAPPING
*Mapping can be done as follows: OS with another OS, microcontroller with other
microcontroller circuits for port communication.
iii. Digital Camera
The design process of Digital Camera includes the following steps:
1. Abstraction
*Abstraction shows the hardware and software components.
*Clear visual display.
*Enhanced imaging processor.
*Should be anti-blur.
*Should record High definition video clips.
*It should have audio video output port to connect TV/DVD player.
2.Hardware and software architecture
*Hardware architecture is abstracted as;
Microcontroller or ASIP, Multiple Processor (DSP, Pixel Processor), RAM, ROM, Flash
memory, Timer, Direct memory access controller, LCD controller, and Battery.
*Software architecture is abstracted as;
CCD signal processing for off-set and Memory a file system
3.Extra functional properties
*USB and WIFI connectivity with computer and printer.
4.System related family of design
*Popular versions of digital camera family are considered.
5.Modular design
System designing is decomposition of hardware and software modules.
*Camera H/W Modules are as follows:
Display system, CD pixel processor, CODEC, JPEG encoder & decoder, Network controller,
Port controller.
*Camera S/W modules are as follows:
CCD signal processing, Jpeg coding and decoding, Pixel processing, LCD & USB port
device drivers, and Communication controller.