0% found this document useful (0 votes)
18 views21 pages

ES-Unit-1-Embedded Sustem

The document provides an overview of embedded systems, detailing their definitions, classifications, and the roles of microprocessors, microcontrollers, and digital signal processors (DSPs). It explains the differences between CISC and RISC architectures, highlighting their characteristics and applications in embedded systems. Additionally, it discusses the hardware units essential for embedded systems, including power sources and functional components.

Uploaded by

vivekvivek662005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views21 pages

ES-Unit-1-Embedded Sustem

The document provides an overview of embedded systems, detailing their definitions, classifications, and the roles of microprocessors, microcontrollers, and digital signal processors (DSPs). It explains the differences between CISC and RISC architectures, highlighting their characteristics and applications in embedded systems. Additionally, it discusses the hardware units essential for embedded systems, including power sources and functional components.

Uploaded by

vivekvivek662005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

RVS COLLEGE OF ARTS AND SCIENCE, (AUTONOMOUS)


SULUR, COIMBATORE -641402

DEPARTMENT OF ELECTRONICS
Staff Name: I.BALAKRISHNAN, M.Sc., M.Phil., Class: II-B.Sc.,(IoT) Unit: I

Paper Code: 43A Paper Name: Embedded Systems and PIC Microcontroller
UNIT-1
(Embedded Systems)
1.1. Definition:
"An embedded system is a system that has embedded software and computer-hardware,
which makes it a system dedicated for an application(s) or specific part of an application
or product or a part of a larger system."
1.2. Classification of Embedded Systems:
We can classify embedded systems into three types as follows.
1. Small scale embedded systems
2. Medium scale embedded systems
3. Sophisticated embedded systems
1.2.1. Small scale embedded systems:
These systems are designed with a single 8- or 16-bit.microcontroller.
They have little hardware and software complexities and involve board-level design.
When developing embedded software for these, an editor, assembler and cross
assembler, an integrated development environment (ISE) tool specific to the
microcontroller or processor 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.
It is essential to monitor and limit the power dissipation when the system is running
continuously.
1.2.2. Medium scale embedded systems:
These systems are usually 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
for the various functions (for example, bus interfacing)
Medium scale embedded systems have both hardware and software complexities.
For complex software design, the following programming tools are available, such as
C/C++/Visual C++/Java, RTOS, Source Code Engineering Tool, simulator, debugger and
an integrated development environment (IDEs).
Software tools also provide solutions to hardware complexities.
1.2.3. Sophisticated embedded systems:
Sophisticated embedded systems have enormous hardware and software complexities
And may need several IPs, ASIPs, scalable processors or configurable processors and
programmable logic arrays.
They are used for cutting edge applications that need hardware and software co-
design and components that have to be integrated in the final system.
They are constrained by the processing speeds available in their hardware units.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 1
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

Certain software functions such as encryption and deciphering algorithms, discrete


cosine transformation and inverse transformation algorithms, TCP/ IP protocol
stacking and network driver functions are implemented in the hardware to obtain
additional speeds.
The software implements some of the functions of the hardware resources in the
system.
Development tools for these systems may not be readily available at a reasonable cost
or may not be available at all.
In some cases, a compiler or retargetable compiler might have to be developed for
these.
1.3. Overview of microprocessor, Microcontrollers and DSPs:
1.3.1. Microprocessor:
A microprocessor is used as general-purpose processor when large embedded software has
to be located in the external memory chips.
The CPU is a unit that centrally fetches and processes a set of general-purpose
instructions.
The CPU instruction set includes instructions for data transfer operations, ALU
operations, stack operations, I/O 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:
A control unit that fetches and controls the sequential processing of a given
command or instruction and communicates with the rest of the system.
An ALU that undertakes arithmetic and logical operations on bytes 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 super scaling
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
controls 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. Examples
of 32-bit processors in 80x86 series are Intel 80386, 80486 and Pentiums.
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).
Different instructions are at different stages (3 to 9) of the pipeline at any given
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 2
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

instance.
A superscalar architecture refers to two or more sets of instructions executing in parallel
pipelines.
The important microprocessors used in the embedded systems are ARM, 68HCxxx, 80x86
and SPARC family of microprocessors.
1.3.2. Microcontroller:
A microcontroller is an integrated chip that has processor, memory and several other
hardware units; these form the microcomputer part of the embedded system.
Just as a 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
having 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.
The functional circuits and some application-specific units (Differs with different family)
present in a microcontroller are given below
Functional circuits
Processor
Internal RAM
Internal Flash/ROM
External Memories Interface
I/O Ports Control and Interfaces/Drivers
Serial UART Communication Port
Serial Synchronous Communication Port
Timers and Watchdog Timer
Interrupt Controller
DMA Controller
Application Specific Circuits in Specific Versions
DMA Controller
Network Driver Stack and Interfaces
A/D Converter ,PWM Circuit for D/A
CAN Controller
Printer Controller, Modem and DTMF Circuit
These Various functional circuits in a microcontroller chip or core in an embedded
system. Also the application-specific units in a specific version of a microcontroller.
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, 68HC11xx,
HC12xx, HC16xx, PIC 16F84 or 16C76, 16F876 and PIC18, microcontroller enhancements
of ARM9/ARM7 from ARM, Intel, Philips, Samsung and ST microelectronics.
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, and Timer, ADC, PWM and CAN controller are required.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 3
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

1.3.3. Digital Signal Processors:


A digital signal processor (DSP) is a processor core or chip for the applications that
process digital signals.
For example, filtering, noise cancellation, echo elimination, compression and encryption
applications.
Just as a microprocessor is the most essential unit of a computing system, a DSP is
essential unit of an embedded system in a large number of applications needing
processing of signals.
Exemplary applications are in image processing, multimedia, audio, video, HDTV, DSP
modem and telecommunication processing systems.
DSPs also find use in systems for recognizing image pattern or DNA sequence.
DSP as an ASIP is a single chip or core in a VLSI unit.
It includes the computational capabilities of a microprocessor and multiply and
Accumulate (MAC) units. A typical MAC has a 16 x 32 MAC unit.
DSP executes discrete-time, signal-processing instructions.
It has Very Large Instruction Word (VLIW) processing capabilities, it processes Single
Instruction Multiple Data (SIMD) instructions, it processes Discrete Cosine Transformations
(DCT) and inverse DCT (IDCT) functions.
The latter are used in algorithms for signal analyzing, coding, filtering, noise cancellation,
echo elimination, compressing and decompressing, etc.
Some major DSPs for embedded systems are
TMS320C (Texas Instruments), Tiger SHARK (Analog Devices), 5600xx (Motorola),
PXN1300, 15002 (Philips).
1.4. Exemplary high performance Processors:
A General Purpose Processor / microprocessor can be embedded on a VSLI chip.
List of different streams of microprocessors embedded in a complex system design are
given below.

Microprocessor Family Source CISC or RISC or Both features


68HCxxx Motorola CISC
80x86 Intel CISC
SPARC Sun CISC
ARM ARM RISC with CISC functionality

Microcontroller VLSI cores or chips for embedded systems are usually among the five
streams of families given below.
Major microcontrollers used in the embedded systems.
Microcontroller Family Source CISC or RISC or Both

68HC11xx, HC12xx, HC16xx Motorola CISC


8051, 8051MX Intel, Philips CISC
PIC 16F84, 16C76, 16F876 and PIC18 Microchip CISC
CORTEX-M3, ARM9/ARM7, ARM, Texas, Philips RISC core with
ST Microcontrollers Samsung CISC Functionality

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 4


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

Digital Signal Processors embedded in to systems are listed below


Microcontroller Family Source
TMS320Cxx, OMAP Texas
Tiger SHARC Analog Devices
5600xx Motorola
PNX1300, 1500 Philips
1.5. CISC and RISC Architectures:
RISC and CISC are two different types of computer architectures that are used to design
the microprocessors that are found in computers.
The fundamental difference between RISC and CISC is that RISC (Reduced Instruction Set
Computer) includes simple instructions and takes one cycle, while the CISC (Complex
Instruction Set Computer) includes complex instructions and takes multiple cycles.
CISC (Complex Instruction Set Computer)The CISC architecture comprises a complex
instruction set. A CISC processor has a variable-length instruction format. In this
processor architecture, the instructions that require register operands can take only two
bytes.
1.5.1. CISC (Complex Instruction Set Computer):
In CISC processor architecture, the instructions which require two memory addresses can
take five bytes to comprise the complete instruction code.
Therefore, in a CISC processor, the execution of instructions may take a varying number
of clock cycles.
The CISC processor also provides direct manipulation of operands that are stored in the
memory.
The primary objective of the CISC processor architecture is to support a single machine
instruction for each statement that is written in a high-level programming language.
The following are the important characteristics of a CISC processor architecture −
CISC can have variable-length instruction formats.
It supports a set of a large number of instructions, typically from 100 to 250
instructions.
It has a large variety of addressing modes, typically from 5 to 20 different
modes.
CISC has some instructions which perform specialized tasks and are used
infrequently.
CISC architectures have a large, complex instruction set and a less efficient execution
pipeline.
This allows CISC processors to perform a wider range of tasks, but they are not as fast as
RISC processors when executing instructions.
1.5.2. RISC (Reduced Instruction Set Computer):
In the RISC architecture, the instruction set of the computer system is simplified to
reduce the execution time.
RISC architecture has a small set of instructions that generally includes register-to-
register operations.
The RISC architecture uses comparatively a simple instruction format that is easy to
decode.
The instruction length can be fixed and aligned to word boundaries.
RISC processors can execute only one instruction per clock cycle.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 5
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

The following are some important characteristics of a RISC Processor −


A RISC processor has a few instructions.
RISC processor has a few addressing modes.
All operations are performed within the registers of the CPU.
RISC processor can be of fixed-length.
RISC can be hardwired rather than micro-programmed control.
RISC is used for single-cycle instruction execution.
RISC processor has easily decodable instruction format.
RISC architectures are characterized by a small, simple instruction set and a highly
efficient execution pipeline.
This allows RISC processors to execute instructions quickly, but it also means that they
can only perform a limited number of tasks.
1.5.3. Difference between RISC and CISC:
S.No. RISC CISC
1 It stands for Reduced Instruction Set It stands for Complex Instruction Set
Computer. Computer.
2 It is a microprocessor architecture that This offers hundreds of instructions of
uses small instruction set of uniform different sizes to the users.
length.
3 These simple instructions are executed This architecture has a set of special purpose
in one clock cycle. circuits which help execute the instructions
at a high speed.
4 These chips are relatively simple to These chips are complex to design.
design.
5 They are inexpensive. They are relatively expensive.
6 Examples of RISC chips include SPARC, Examples of CISC include Intel architecture,
POWER PC. AMD.
7 It has less number of instructions. It has more number of instructions.
8 It has fixed-length encodings for It has variable-length encodings of
instructions. instructions.
9. Simple addressing formats are The instructions interact with memory using
supported. complex addressing modes.
10. It doesn't support arrays. It has a large number of instructions. It
supports arrays.
11. It doesn't use condition codes. Condition codes are used.
12. Registers are used for procedure The stack is used for procedure arguments
arguments and return addresses. and return addresses.

1.6. Hardware Units in an Embedded System:


1.6.1. Power Source:
Most systems have a power supply of their own.
The Network Interface Card (NIC) and Graphic Accelerator are examples of embedded
systems that do not have their own power supply and connect to PC power- supply lines.
The supply has a specific operation range or a range of voltages.
Various units in an embedded system operate in one of the following four power ranges as

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 6


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

5.0V, +0.25V, 3.3 V, ±0.3 V, 2.0V, ± 0.2 V and 1.5V, ±0.2 V.


There is generally an inverse relationship between propagation delay in the gates and
operational voltage.
Therefore, the 5V system processor and units are used in most high performance systems.
Certain systems do not have a power source of their own they connect to external power
supply or are powered by the use of charge pumps.
Low voltage operations:
1. In portable or hand-held devices such as a cellular phone [when compared to 5 V, a
CMOS 2 V circuit power dissipation reduces by one-sixth, ~ (2 V/5 V)2. This also
increases the time intervals needed for recharging a battery by a factor of six.].
2. In a system with smaller overall geometry, low voltage system processors and IO
circuits generate lesser heat and thus can be packed into a smaller space.
3. A power supply source or a charge pump is essential in every system.
1.6.2. Clock Oscillator Circuit and Clocking Units:
The clock controls the time for executing an instruction.
After the power supply, the clock is the basic unit of a system.
A processor needs a clock oscillator circuit.
The clock controls the various clocking requirements of the CPU, of the system timers
and the CPU machine cycles.
The machine cycles are for fetching codes and data from memory and then decoding and
executing them at the processor and for transferring the results to memory.
For processing units, a highly stable oscillator is required and the processor clock-out
signal provides the clock for synchronizing all system units with the processor.
1.6.3. System Timers and Real-time Clocks:
A timer circuit is suitably configured as the system-clock, which ticks and generates
system interrupts periodically, for example, 60 times in 1s.
The interrupt service routines then perform the required operation.
A timer circuit is suitably configured as the real-time clock (RTC) that generates system
interrupts periodically for the schedulers, real-time programs and for periodic saving of
time and date in the system.
The RTC or system timer is also used to obtain software-controlled delays and time-outs.
An RTC functions as driver for software timers (SWTS).
Microcontrollers also provide internal timer circuits for counting and timing devices.
To schedule the various tasks and for real-time programming, an RTC or system clock is
needed.
The clock also drives the timers for various timing and counting needs in a system.
1.6.4. Reset Circuit, Power-up Reset and Watchdog-Timer Reset:
Reset means that the processor begins the processing of instructions from a starting
address.
That address is one that is set by default in the processor PC on a power-up.
From that address in memory, program-instructions are fetched following the reset of the
processor.
A program that is reset and runs on a power-up can be one of the following:
i. A system program that executes from the beginning.
ii. A system boot-up program.
iii. A system initialization program.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 7
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

In certain processors, for example, 68HC11 and HC12, there are two start-up addresses.
One is based on the power-up reset vector and the other on the reset vector after the
reset instruction or after a time-out (for example, from a watchdog timer).
The processor fetches the bytes for the PC from the first power-up reset vector on
power-up.
The processor fetches the bytes for the PC from the second reset vector on the watchdog
timer timing out or on executing the reset instruction.
The reset circuit activates for a fixed number of Clock Cycles and then deactivates.
The processor circuit keeps the reset pin active and then deactivates to let the program
proceed from a default beginning address.
On deactivation of the reset that succeeds the processor activation, a program executes
from a start-up address.
Reset can be activated by an external reset circuit that activates on power-up, on
switching-on reset of the system or on detection of a low voltage (e.g. <4.5 V when what
is required is 5 V on the system supply rails).
This circuit output connects to a pin called the reset pin of the processor.
This circuit may be a simple RC circuit, an external IC circuit or a custom-built IC.
Examples of ICs are MAX 6314 and Motorola MC 34064.
Alternatively, it can also be activated by any one of the following:
i. software instruction
ii. time-out by a programmed timer known as a watchdog
iii. A clock monitors detecting a slowdown below certain frequencies.
The watchdog timer is a timing device that resets the system after a predefined timeout.
It is activated within the first few clock cycles after power-up.
It has a number of applications. In many embedded systems reset by a watchdog timer is
very essential because it helps in rescuing the system if a fault develops and the program
gets stuck.
On restart, the system can function normally.
Most microcontrollers have on-chip watchdog timers.
The watchdog timer reset is a required feature in control applications.
1.6.5. Memory:
In a system, there are various types of memory. The list of various forms of memory that
is present in systems.
1. Internal RAM of 256 or 512 bytes in a microcontroller for registers, temporary data
and stack.
2. Internal ROM/PROM/EPROM for about 4 kB to 64 kB of program (in the case of
microcontrollers).
3. External RAM for the temporary data and stack (in most systems) or internal
caches (in the case of certain microprocessors).
4. Internal flash (in many systems the results of processing can be saved in
nonvolatile memory: for example, system status periodically and images, songs, or
speeches after suitable format compression).
5. Memory stick (or card): video, images, songs, or speeches and large storage in
digital camera and mobile systems.
6. External ROM or PROM for embedding software (in almost all systems other than
microcontroller based systems).
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 8
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

7. RAM memory buffers at ports.


8. Caches (in pipelined and superscalar microprocessors).
Various Forms of System Memory
Internal RAM at Microcontrollers
RAM at System- on- Chip or External RAM
Internal Caches at Microprocessors (Holds copies of System Memory pages)
External RAM Chips
Flash / EEPROM (Internal and /or External)
ROM / PROM (Internal and /or External)
Memory Addresses at the system ports
The following Table gives the functions assigned in embedded systems to the memories.
S. No Memory Needed Function
Storing application programs from where the processor
fetches the instruction codes. Storing codes for system
ROM or EPROM
1 booting, initializing, initial input data and strings. Codes for
or flash
RTOS. Pointers (addresses) of various interrupt service
routines (ISRs).
RAM (internal and Storing the variables during program run and storing the
2 external) and RAM stack. Storing input or output buffers, for example, for
for buffer speech or image.
A flash memory stick is inserted in mobile computing system
Memory stick or digital-camera. It stores high definition video, images,
3
songs, or speeches after a suitable format compression and
stores large persistent data.
4 EEPROM or Flash Storing nonvolatile results of processing.
Storing copies of instructions and data in advance from
5 Cache external primary memory and storing the results temporarily
during processing.
A system embeds (locates) the following either in the internal flash or ROM, PROM or in
an external flash or ROM or PROM of the microcontroller:
boot-up program, initialization data, strings or pictogram for screen-display or
initial state of the system, programs for various tasks, ISRs and operating system
kernel.
The system has RAMs for saving temporary data, stack and buffers that are needed during
a program run.
The system uses flash for storing nonvolatile results.
1.6.6. Input, Output and IO Ports, 10 Buses and IO Interfaces:
The system gets inputs from physical devices through the input ports.
Examples are as follows:
1. A system gets inputs from the touch screen, keys in a keypad or keyboard, sensors
and transducer circuits.
2. A controller circuit in a system gets inputs from the sensor and transducer circuits.
3. A receiver of signals or a network card gets the input from a communication
system.
4. Port receives inputs from a network or peripheral.

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 9


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

Consider the system in a mobile phone. A user inputs the mobile number through the
buttons, directly or indirectly (through recall of the number from its memory).
Keypad keys connect to the system through an input port.

A processor identifies each input port by its memory buffer addresses, called port
addresses.
Just as a memory location holding a byte or word is identified by an address, each input
port is also identified by the address.
The system gets the inputs by the read operations at the port addresses.
The system has output ports through which it sends output bytes to the real world.
Examples are as follows:
1. Output may be sent to a light emitting diode (LED), liquid crystal display (LCD) or
touch screen display panel. For example, a calculator or mobile phone system
sends the output-numbers or an SMS message to the LCD display.
2. A system may send the output to a printer.
3. Output may be sent to a communication system or network.
4. A control system sends the outputs to alarms, actuators, furnaces or boilers.
5. A robot is sent output for its various motors.
Each output port is identified by its memory-buffer addresses (called port addresses).
The system sends the output by a write operation to the port address.
There are also general-purpose ports for both the input and output (IO) operations.
For example, a mobile phone system sends output as well as gets input through a wireless
communication channel.
A mobile computing system touch screen system sends output as well as gets input when
a user touches the menu displayed or key on the screen.
Each IO port is also identified by an address to which the read and write operations both
take place.
Ports can have serial or parallel communication with the system address and data buses.
In serial communication a one-bit data line is used and bits are sent serially in successive
time slots.
Universal Asynchronous Receiver and Transmitter (UART) is a popular communication
protocol for serial communication.
In parallel communication, several data lines are used and bits are sent in parallel.
A system port may have to send output to multiple channels.
A demultiplexer or multiplexer circuit is then used.
A demultiplexer is a digital circuit that sends digital outputs at any instance to one of the
provided channels.
The channel to which the output is sent is the one that is addressed by the channel
address bits at the demultiplexer input.
A demultiplexer takes the input and transfers it to a select channel output among the
multiple output channels,
A multiplexer is a digital circuit that receives digital inputs at any instance from multiple
channels, and sends data output only from a specific channel at an instance.
The channel address bits are at multiplexer input.
A multiplexer takes the input from one among the multiple input channels and transfers a
selected channel input to the output.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 10
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

A system unit (for example, memory unit or IO port or device) may have to be selected
from among the multiple units in the system and activated.
A decoder circuit when used as an address decoder decodes the input addresses and
activates the selected output channel from among the many outputs.
For example, there are 8 units of which one has to be selected.
An address-select input of 3 bits is input to the decoder. Based on the input address, the
output select line among the 8 activates. If the input address bit is 000, then the 0th
output is active and the 0th unit activates. If the input address bit is 111, then the 7th
output is active and the 7th unit activates.
1.6.7. Bus:
A system might have to be connected to a number of other devices and systems.
A bus consists of a common set of lines to connect multiple devices, hardware units and
systems for communication between any two of these at any given instance.
A bus communication protocol specifies how signals communicate on the bus.
A bus may be a serial or parallel bus that transfers one or multiple data bits at an
instance, respectively.
The protocol also specifies the following:
(i) ways of arbitration when several devices need to communicate through the bus
(ii) ways of polling bus requirement from each device at an instance
(iii) ways of daisy chaining the devices so that bus is granted to a device according to the
device-priority in the chain.
For networking the distributed units or systems, there are different types of serial and
parallel bus protocols: 12C, CAN, USB, ISA, EISA and PCI. For wireless networking of
systems there are 802.11, IrDA, Bluetooth and ZigBee protocols.
A system connects to external physical devices and systems through parallel or serial I/O
ports.
Demultiplexers and multiplexers facilitate communication of signals from multiple
channels through a common path.
A system often networks to the other devices and systems through an I/O bus for
example, I2C, CAN, USB, ISA, EISA and PCI bus.
1.6.8. DAC Using a PWM and an ADC:
DAC is a circuit that converts digital 8 or 10 or 12 bits to the analog output.
The analog output is with respect to the reference voltage.
When all input bits are equal to 1, then the analog output is the difference between the
positive and negative reference pin voltages; when all input bits equal 0, then the analog
output equals -ve reference pin voltage (usually 0 V).
Suppose a system needs to give the analog output of a control circuit for automation.
The analog output may be to a power system for DC motor or furnace.
A pulse width modulator (PWM) with an integrator circuit is used for the DAC.
A PWM unit in the microcontroller operates as follows: Pulse width is made proportional
to the analog-output needed.
PWM inputs are from 00000000 to 11111111 for an 8-bit DAC operation.
The PWM unit outputs to an external integrator, which provides the desired analog
output.
Analog to Digital Converter:
ADC is a circuit that converts the analog input to digital 4, 8, 10 or 12 bits.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 11
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

The analog input is applied between the positive and negative pins and is converted with
respect to the reference voltage.
When input is equal to difference of reference positive and negative voltages, then all
output bits equal 1; when equals negative reference voltage (usually 0 V), then all output
bits equal 0.
The ADC in the system microcontroller can be used in many applications such as data
acquisition systems (DAS), digital cameras, analog control systems and voice digitizing
systems.
Suppose a system gets the analog inputs from sensors of temperature, pressure, heart-
beats and other sources in a DAS.
Suppose a system needs to read an analog input from a sensor or transducer circuit.
If converted to bits by the ADC unit in the system, then these bits, after processing, can
also give an output.
This provides a control for automation by a combined use of ADC and DAC features.
The converted bits can be given to the port meant for digital display.
The bits may be transferred to a memory address, a serial port or a parallel port.
A processor may process the converted bits and generate a Pulse Code Modulated (PCM)
output.
PCM signals are used to digitize voice into a digital format.
An ADC unit can be repeatedly used after the intervals equal to the conversion time.
Therefore, one can digitizes the DAS sensor signals, CCD signals, voice, music or video
signals, or heart beat sensor signals in different systems.
An ADC unit in an embedded system microcontroller may have multichannel.
It can then take the inputs in succession from the various pins interconnected to different
analog sources.
For automatic control and signal processing applications, a system provides necessary
interfacing circuit and software for the Digital to Analog Conversion (DAC) unit and
Analog to Digital Conversion (ADC) unit.
A DAC operation is done with the help of a combination of a PWM unit in the
microcontroller and an external integrator chip.
ADC operations are required for data acquisition, image processing, voice processing,
video processing, instrumentation and automatic control systems.
1.6.9. LCD, LED and Touch screen Displays:
A system requires an interfacing circuit and software to display the status or message for
a line, for multiline displays, or for flashing displays.
An LCD screen may show up a multiline display of characters or also show a small graph or
icon (called a pictogram).
A recent innovation in the mobile phone system turns the screen blue to indicate an
incoming call.
Third generation system phones have both image and graphic displays.
An LCD needs little power. A supply or battery (a solar panel in the calculator) powers it.
The LCD is a diode that absorbs or emits light and 3 to 4 V and 50 or 60 Hz voltage-pulses
with currents less than -50 µA are required.
The pulses are applied with the same polarity on the crystal front and back plane for no
light, and with opposite polarity for light. Here, polarity means logic '1' or '0'.
A display-controller is often used in case of matrix displays.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 12
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

To indicate the ON status of the system, there may be an LED that glows.
A flashing LED may indicate that a specific task is under completion or is running or in
wait status.
The LED is a diode that emits yellow, green, red or infrared light in a remote controller
on application of a forward voltage of between 1.6 to 2V.
It needs current up to 12 mA above 5 mA (less in flashing display mode).
It is much brighter than the LCD, making it suitable for flashing displays and for displays
limited to a few digits.
A touch screen is an input as well as an output device, which can be used to enter a
command, a chosen menu or to give a reply.
The information is input by physically touching at a screen position using a finger or a
stylus.
A stylus is thin pencil-shaped object. It is held between the fingers and used just as a
pen.
The screen displays the choices or commands, menus, dialog boxes and icons.
The display-screen display is similar to a computer video display unit screen.
Newer touch screen senses the fingers even from proximity, for example, in Apple
iPhone.
The system may need the necessary interfacing circuit and software for the output to the
LCD display controller and the LED interfacing ports or for the I/Os with the touch screen.

1.6.10. Keypad/Keyboard:
The keypad or keyboard is an important device for getting user inputs.
The system provides the necessary interfacing and key-debouncing circuit as well as the
software for the system to receive input from a set of keys, from a keyboard, keypad or
virtual keypad.
A touch screen provides for a virtual keypad in a mobile computing system.
A virtual keypad is a keypad displayed on the touch screen where the user can enter the
keys using a stylus or finger.
A keypad has upto a maximum of 32 keys.
A keyboard may have 104 keys or more. The keypad or keyboard may interface serially or
parallelly to the processor directly through ports or through a controller.
Mobile phones may have a T9 keypad. A T9 keypad has 16 keys and four up-down right-
left menu keys. Using 0 to 9 keys text messages, such as SMS messages, are generated.
For inputs, a keypad or board may interface to a system. The system provides necessary
interfacing circuit and software to receive inputs directly from the keys or through a
controller.
1.6.11. Pulse Dialer, Modem and Transceiver:
For user connectivity through the telephone line, wireless or a network, a system
provides the necessary interfacing and circuits.
It also provides the software for pulse dialing through the telephone line, for modem
interconnection for fax, for Internet packets routing and for transmitting and connecting
to a wireless cellular system or personal area wireless network.
A transceiver is a circuit that can transmit as well as receive byte streams.
In communication system, a pulse dialer, modem or transceiver is used.

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 13


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

1.6.12. Interrupt Handler:


A timing device sends a time-out interrupt when a preset time elapses or sends a
compare interrupt when the present-time equals the preset time.
Assume that data have to be transferred from a keyboard to a printer. A port peripheral
generates an interrupt on receiving the input data or when the transmitting buffer
becomes empty. Each action generates an interrupt.
A system may possess a number of devices and the system processor has to control and
handle the requirements of each device by running an appropriate ISR (interrupt service
routine) for each.
An interrupts-handling mechanism must exist in each system to handle interrupts from
various processes and for handling multiple interrupts simultaneously pending for service.
Important points regarding the interrupts and their handling by the program are as
follows.
1. There can be a number of interrupt sources and groups of interrupt sources in a
processor.
2. The system may prioritize sources and service them accordingly.
3. Certain sources are not maskable and cannot be disabled. Some are assigned the
highest priority during processing.
4. The processor's current program has to divert to a service routine to complete that
task on the occurrence of the interrupt
5. There is a programmable unit on-chip for the interrupt handling mechanism in a
microcontroller.
6. The operating system is expected to control the handling of interrupts and running
of routines for the interrupts in a particular application.
7. The system always gives priority to the ISRs over the tasks of an application.
8. A system provides an interrupt handling mechanism for executing the ISRs in case
of the interrupts from physical devices, systems, software instructions and
software exceptions.
1.7. Embedded Software in a System:
The software is like the brain of
the embedded system.
1.7.1. Final Machine Implementable
Software for a System:
An embedded system processor
executes software that is specific
to a given application of that
system.
The instruction codes and data in
the final phase are placed in the
ROM or flash memory for all the
tasks that are executed when the
system runs.
The software is also called ROM
image. Figure 1 : System ROM memory embedding the software, RTOS,
A machine implementable software data and vector addresses
file is therefore like a table having in each rows the address and bytes.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 14
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

The bytes are saved at each address of the system memory.


The table has to be readied as a ROM image for the targeted hardware.
The above figure shows the ROM image in a system memory. The image consists of the
boot up program, stacks address pointers, program counter address pointers, application
programs, ISRS, RTOS, input data and vector addresses.
The final machine implementable software for a product embeds in the once
programmable flash or ROM (or PROM) as an image in a frame.
Bytes at each address must be defined to create the ROM image.
By changing this image, the same hardware platform will work differently and can be
used for entirely different applications or for new upgrades of the same system.

1.7.2. Coding of Software in Machine Codes:


During coding in this format, the programmer defines the addresses and the
corresponding bytes or bits at each address.
In configuring some specific physical device or subsystem, machine code-based coding is
used.
For example, in a transceiver, placing certain machine code and bits can configure it to
transmit at specific megabytes per second or gigabytes per second, using specific bus and
networking protocols.
Another example is using certain codes for configuring a control register with the
processor.
During a specific code-section processing, the register can be configured to enable or
disable use of its internal cache.
However, coding in machine implementable codes is done only in specific situations
because it is time consuming and the programmer must first have to understand the
processor instructions set and then memorize the instructions and their machine codes.

1.7.3. Software in Processor Specific Assembly Language:


A program or a small specific part can be coded in assembly language using an assembler
after understanding the processor and its instruction set.
Assembler is software used for developing codes in assembly language.
Assembly language coding is extremely useful for configuring physical devices like ports,
a line-display interface, ADC and DAC and reading into or transmitting from a buffer.
These codes are also called low-level codes for the device driver functions.
They are useful to run the processor or device-specific features and provide an optimal
coding solution.
To make all the codes in assembly language may be very time consuming.
Full coding in assembly may be done only for a few simple, small-scale systems, such as
toys, automatic chocolate vending machines, robots or data acquisition systems.
The figure shows the process of converting an assembly language program into machine
implementable software file and then finally obtaining a ROM image file.
1. An assembler translates the assembly software into the machine codes using a step called
assembling.
2. In the next step, called linking, a linker links these codes with the other codes required.

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 15


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

Linking is necessary because of the


number of codes to be linked for
the final binary file.
For example, there are the
standard codes to program a delay
task for which there is a reference
in the assembly language program.
The codes for the delay must link
with the assembled codes.
The delay code is sequential from a
certain beginning address.
The assembly software code is also
sequential from a certain beginning
address.
Both the codes have to be linked at
the distinct addresses as well as at the Figure 2: Process of Converting ALP into ROM Image)
available addresses in the system.
The linked file in binary for run on a computer is commonly known as an executable
file or simply an '.exe' file.
After linking, there has to be reallocation of the sequences of placing the codes before
actually placing the codes in memory.
3. In the next step, the loader program performs the task of reallocating the codes after
finding the physical memory addresses available at a given instant.
The loader is a part of the operating system and places codes into the memory after
reading the '.exe' file.
This step is necessary because the available memory addresses may not start from
0x0000, and binary codes have to be loaded at different addresses during the run.
The loader finds the appropriate start address. In a computer, after the loader loads
into a section of RAM, the program is ready to run.
4. The final step of the system design process is locating these codes as a ROM image.
The codes are permanently placed at the addresses actually available in the ROM.
In embedded systems, there is no separate program to keep track of the available
addresses at different times during the run, as in a computer.
In embedded systems, therefore, the next step instead of loader after linking is the
use of a locator, which locates the IO tasks and hardware device driver codes at fixed
addresses.
Port and device addresses are fixed for a given system as per the interfacing circuit
between the system buses and ports or devices.
The locator program reallocates the linked file and creates a file for a permanent
location of the codes in a standard format.
The file format may be in the Intel Hex file format or Motorola S-record format. The
designer has to define the available addresses to locate and create files to
permanently locate the codes.
5. Lastly, either
(i) A laboratory system, called device programmer, takes as input the ROM image file
and finally burns the image into the PROM or flash or
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 16
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

(ii) At a foundry, a mask is created for the ROM of the embedded system from the ROM
image file (The process of placing the codes in PROM or flash is also called
burning).The mask created from the image gives the ROM in IC chip form.The file
has the ROM image in a standard format. A device programmer finally burns the
image in the PROM or EPROM. A mask created from the image gives the ROM in IC
chip form.

1.7.4. Software in High Level Language:


Since the coding in assembly language is very time
consuming in most cases, software is developed in a
high- level language, 'C' or 'C++' or visual C++ or 'Java'
in most cases.
'C' is usually the preferred language. The programmer
needs to understand only the hardware organization
when coding in high level language.
For example the coding for square root will need
many lines of code and can be done only by an expert
assembly language programmer.
To write the program in a high level language is very
simple compared to writing it in assembly language.
'C' programs have a feature that adds the assembly
instructions when using certain processor-specific
features and coding for a specific section, for example, a port device driver.
The figure shows the different programming layers in a Figure 3: layers in the embedded
software in C
typical embedded 'C' software.
These layers are as follows.
(i) Processor Commands.
(ii) Main Function.
(iii) Interrupt Service Routine.
(iv) Multiple tasks, say, 1 to N.
(v) Kernel and Scheduler.
(vi) Standard library functions, protocol handling and stack functions.
The Figure shows the process of
converting a C program into the ROM
image file.
A compiler generates the object
codes.
It assembles the codes according to
the processor instruction set and other
specifications.
The C compiler for embedded systems
must, as a final step of compilation,
use a code-optimizer that optimizes
the codes before linking. Figure 4: process of converting a C program into the ROM
image
After compilation, the linker links the
object codes with other needed codes.
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 17
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

For example, the linker includes the codes for the functions printf and sqrt codes.
Codes for device and driver (device) control codes) management also link at this stage:
for example, printer device management and driver codes.
After linking, the other steps for creating a file for ROM image are the same as shown
earlier method of locating and burning.

1.8. Exemplary applications of Embedded Systems:


Embedded systems have very diversified applications.
A few select application areas of embedded systems are telecommunications, smart
cards, missiles and satellites, computer networking, digital consumer electronics, and
automotives.
1.8.1 . Small scale embedded system applications:
2. Point of sales terminals( automatic chocolate vending machine)
3. Stepper motor controllers for a robotics system
4. Washing or cooking systems
5. Multitasking toys
6. Microcontroller-based single or multi display digital panel meter for voltage,
current, resistance and frequency.
7. Keyboard controller.
8. SD, MMI and network access cards, CD drive or hard disk drive controller.
9. The peripheral controllers of a computer, for example, a CRT display controller, a
keyboard controller,
10. a DRAM controller, a DMA controller, a printer controller, a laser printer
controller, a LAN controller, a disk drive controller.
11. Fax or photocopy or printer or scanner machine.
12. Remote controller of TV
13. Telephone with memory, display and other sophisticated features
14. Motor controls systems-for example, an accurate control of speed and position of
the DC motor, robot and CNC machine; automotive applications such as closed
loop engine control, dynamic ride control, and an antilock braking system
monitor.
15. Electronic data acquisition and supervisory control system.
16. Electronic instruments, such as an industrial process controller .
17. Electronic smart weight display system and an industrial moisture recorder cum
controller.
18. Digital storage system for a signal wave form or for electric or water meter
reading system.
19. Spectrum analyzer.
20. Biomedical systems such as an ECG LCD display cum recorder, a blood-cell
recorder cum analyzer and a patient monitor system.
1.8.2. Medium scale embedded systems Applications:
21. Computer networking systems, for example, a router, a front-end processor in a
server, a switch, a bridge, a hub and a gateway
22. For Internet appliances, there are numerous application systems
(i) An intelligent operation, administration and maintenance router (IOAMR) in
a distributed network
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 18
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

(ii) Mail client card to store e-mail and personal addresses and to smartly
connect to a modem or server
23. Entertainment systems such as a video game and a music system
24. Banking systems, for example, bank ATM and credit card transactions
25. Signal tracking systems, for example, an automatic signal tracker and a target
tracker
26. Communication systems such as a mobile communication SIM card, a numeric
pager, a cellular phone, a cable TV terminal and a FAX transceiver with or without
a graphic accelerator
27. Image filtering, image processing, pattern recognizer, speech processing and video
processing
28. Video games
29. A system that connects a pocket PC to the automobile driver mobile phone and a
wireless receiver. The system then connects to a remote server for Internet or e-
mail or to a remote computer at an ASP (application service provider)
30. A personal information manager using frame buffers in handheld devices.
31. Thin client [A thin client provides disk-less nodes with remote boot capability].
Application of thin- client accesses to a data centre from a number of nodes; in an
Internet laboratory accesses to the Internet leased line through a remote server.
32. Embedded firewall/router using ARM7/ multiprocessor with two Ethernet
interfaces and interfaces support to PPP, TCP/IP and UDP protocols.
1.8.3. Sophisticated embedded systems Applications:
33. Mobile smart phones and computing systems.
34. Mobile computer.
35. Embedded systems for wireless LAN and for convergent technology devices.
36. Embedded systems for video, interactive video, broadband IPv6 (Internet Protocol
version 6) Internet and other products, real time video and speech or multimedia
processing systems
37. Embedded interface and networking systems using high speed (400 MHz plus), ultra
high speed (10 Gbps) and a large bandwidth: Routers, LANs, switches and
gateways, SANS (Storage Area Networks), WANS (Wide Area Networks)
38. Security products and high-speed Network security. Gigabit rate encryption rate
products

1.9. Embedded System-On-Chip (SoC) and use of VLSI Circuit Design Technology:
Lately, embedded systems are being designed on a single silicon chip, called System on
chip (SoC), a design innovation.
SoC is a system on a VLSI chip that has all the necessary analog as well as digital circuits,
processors and software.
A SoC may be embedded with the following components:
1. Embedded processor GPP or ASIP core,
2. Single purpose processing cores or multiple processors,
3. A network bus protocol core,
4. An encryption function unit,
5. Discrete cosine transforms for signal processing applications,
6. Memories,
Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 19
43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

7. Multiple standard source


solutions, called IP (Intellectual
Property) cores,
8. Programmable logic device and
FPGA (Field Programmable Gate
Array) cores,
9. Other logic and analog units.
An exemplary application of such
an embedded SoC is the mobile
phone.
Single purpose processors, ASIPS
and IPs on a SoC are configured to
process encoding and
deciphering, dialing, modulating,
demodulating, interfacing the key
pad and multiple line LCD matrix
displays or touch screen, storing data input and recalling data from memory.
The Figure shows an SoC that integrates internal ASICs, internal processors (ASIPs),
shared memories and peripheral interfaces on a common bus.
Besides a processor, memories and digital circuits with embedded software for specific
applications, the SoC may possess analog circuits as well.
1.9.1. Application Specific IC (ASIC):
ASICs are designed using the VLSI design tools with the processor GPP or ASIP and analog
circuits embedded into the design.
The designing is done using the Electronic Design Automation (EDA) tool.
For design of an ASIC, a High-level Design Language (HDL) is used.

1.9.2. IP Core:
On a VLSI chip, there may be integration of high-level components.
These components possess gate-level sophistication in circuits above that of the counter,
register, multiplier, floating point operation unit and ALU.
A standard source solution for synthesizing a higher-level component by configuring an
FPGA core or a core of VLSI circuit may be available as an Intellectual Property, called
(IP).
The designer or the designing company holds the copyright for the synthesized design of
a higher-level component for gate-level implementation of an IP.
An embedded system may incorporate several IPs.
1. An IP may provide hardwired implementable design of a transform, an encryption
algorithm or a deciphering algorithm.
2. An IP may provide a design for adaptive filtering of a signal.
3. An IP may provide a design for implementing Hyper Text Transfer Protocol (HTTP)
or File Transfer Protocol (FTP) or Bluetooth protocol to transmit a web page or a
file on the Internet.
4. An IP may be designed for a USB or PCI bus controller.

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 20


43A: Embedded Systems and PIC Microcontrollers II Year/IV Sem

1.9.3 . FPGA Core with Single or Multiple Processors:


Suppose an embedded system is designed with a view to enhancing functionalities in
future. An FPGA core is then used in the circuits.
It consists of a large number of programmable gates on a VLSI chip.
There is a set of gates in each FPGA cell, called macro cell.
Each cell has several inputs and outputs.
All cells interconnect like an array (matrix).
Each interconnection is programmable through the associated RAM in an FPGA
programming tool.
An FPGA core can be used with a single or multiple processors.
We can configure an algorithm into the logic gates of FPGA.
It gives hardwired implementation for a processing unit.
It is specific to the needs of the embedded system. An algorithm of the embedded
software can implement in one of the FPGA sections and another algorithm in its other
section.
FPGA cores with a single or multiple processor units on chip are used.
One example of such core is Xilinx Virtex-II Pro FPGA XC2VP125.
XC2VP125 from Xilinx has 125136 logic cells in the FPGA core with four IBM PowerPCs.
It has been used as a data security solution with encryption engine and data rate of 1.5
Gbps.
Other examples of embedded systems integrated with logic FPGA arrays are DSP-enabled,
real-time video processing systems and line echo eliminators for the Public Switched
Telecommunication Networks (PSTN) and packet switched networks.

Mr. I. Balakrishnan, Asst.Prof/Department of Electronics |RVSCAS 21

You might also like