ES-Unit-1-Embedded Sustem
ES-Unit-1-Embedded Sustem
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
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
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
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
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.
(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.
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.
(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
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.