Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Unit 1 Introduction

Embedded systems are specialized computer systems designed for specific tasks, integrating hardware and software into larger products. They utilize components such as microcontrollers, memory (ROM/RAM), and various input/output interfaces, and are characterized by real-time operation, limited resources, and specific functionalities. Applications range from consumer electronics to automotive systems, with a focus on data processing, control, and communication.

Uploaded by

yohanesgenene1
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Unit 1 Introduction

Embedded systems are specialized computer systems designed for specific tasks, integrating hardware and software into larger products. They utilize components such as microcontrollers, memory (ROM/RAM), and various input/output interfaces, and are characterized by real-time operation, limited resources, and specific functionalities. Applications range from consumer electronics to automotive systems, with a focus on data processing, control, and communication.

Uploaded by

yohanesgenene1
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 74

Embedded

Systems
Unit One
 An embedded system is a computer system that is designed to perform a specific
task or set of tasks.
 It is a combination of hardware and software that is integrated into a larger
system or product.
 Unlike general-purpose computers, which are designed to run a wide range of
applications, embedded systems are typically designed to perform a single
function or a limited set of functions.(User Interface)
(display, keypad etc.)

Embedded Computer
Conditioning

Conversion
Signal

Input

Output
Drive
Data Output
Variables Software Variables

Hardware

The Embedded System –


(Link to other Systems) Generic Block Diagram
Embedded System
Software
Component
1. Editor: The editor is the first tool you required for embedded system software. The code
you write in C and C++ programming languages will be saved in a text file in the editor.
This editor supports scores of languages including Java, C, HTML, Python.

2. Compilers: Compilers are software tools that convert high-level programming code
into machine code that can be executed by the embedded system's processor.

3. Assembler: converts the written code into a machine language. It is


slightly different than a compiler.

 The compiler directly converts the written code into machine


language

 The assembler, first converts source code to object code and then to the
language that the machine can understand(Machine Code).

4. Linker is a software tool that is used in the process of compiling a program.

 Its main function is to take object files generated by the compiler and combine
5. Debuggers: Debuggers are software tools that allow developers to identify and
fix bugs in software code.

 They provide features such as breakpoints, watchpoints, and memory inspection


tools.

6. Emulators: Emulators are hardware or software tools that simulate the


behaviour of an embedded system's processor.

 They allow developers to test software code on a simulated version of the


target hardware, which can be useful for debugging and testing purposes.

7. Integrated Development Environments (IDEs ): IDEs are software applications that


provide a comprehensive environment for developing software code.

 They typically include features such as code editors, debugging tools, and project
management tools. Examples of popular IDEs for embedded systems include Micro C,
Eclipse, Visual Studio, and Code Composer Studio.
1. Power Supply
A power supply is a crucial component of the embedded system design. It is an electrical device
mainly used to power up the electrical load. Normally, a 5V power supply is required for the
system, however, it can also range from 1.8 to 3.3V. You can pick either one based on your
requirements and application. To work the embedded system properly, a smooth and efficient
power supply is needed. Both wall adopter and battery can be used as a power supply.
2. Microcontroller
An embedded system is either a microcontroller-based or microprocessor based system.
They give a system computing power and are called integrated circuits. The embedded
hardware performance is mainly dependent on the processor which is normally called the brain
of the embedded system. Pick from a range of processors including 8-bit, 16-bit, and 32-bit
processors. They are different in terms of processing speed. For example, a 32-bit processor
comes with more processing speed and can manipulate 32-bits at a time while an 8-
bit processor comes with less processing speed and can manipulate 8-bits at a time.
For simple applications, an 8-bit processor would suffice while for complex and advanced
3. ROM/RAM Memory
Memory is essential to store important information in the embedded computer
system. Memory is integrated into a microcontroller or microprocessor. There
are two types of memories including ROM (read-only-memory) and RAM
(random access memory). The former is called the code memory that stores the
program code and is non-volatile which means it stays stored in the system
when the power supply is removed. While latter is called the data memory and
is a volatile memory which means it is used for temporally storing the
information and is removed from the system when the power supply is turned
off.
4. Timers / Counters
Sometimes you need to create a delay before a specific function. Timers are
5. Communication Ports
Communication ports are used in embedded systems to establish communication
with other embedded systems. There are several communication ports including
USB, UART, I2C, SPI, and RS-485.
For simple applications, communications ports are utilized from the microcontroller,
and for complex and advanced applications these ports are externally installed
inside the embedded systems.
6. Output and Input
Input is required to interact with the embedded system. A sensor can be used to
provide input to the system. The microcontroller pins used in the system can be
configured as an input or output port. In the microcontroller, there are a fixed
number of input and output ports that you can utilize as per your requirement.
7. Electrical component and Circuit
A PCB (printed circuit board), Resistors, Capacitors, Diodes, Integrated Circuits,
Characteristics of Embedded System

1. Real-time operation: Embedded systems are often designed to respond to events


or inputs in real-time, meaning they must process data and produce output within
strict time constraints.

2. Limited resources: Embedded systems typically have limited resources in terms of


memory, processing power, and energy consumption. This requires careful optimization of
software and hardware design to achieve the desired functionality within these constraints.

3. Specific functionality: Embedded systems are designed to perform a specific function or


set of functions, often with a high degree of reliability and predictability.

4. Integration with hardware: Embedded systems are often tightly integrated with
hardware components, such as sensors, actuators, and communication interfaces.

5. Customized software: Embedded systems often require customized software that is


tailored to the specific hardware and application requirements.

6. Low cost: Embedded systems are often designed for mass production, which requires
low-cost components and manufacturing processes.
Application Areas
(1) Consumer electronics: Camcorders, cameras, etc.
(2) Household appliances: Television, DVD players, washing machine, fridge, microwave
oven, etc.
(3) Home automation and security systems: Air conditioners, sprinklers, intruder
detection alarms, closed circuit television cameras, fi re alarms, etc.
(4) Automotive industry: Anti-lock breaking systems (ABS), engine control, ignition systems,
automatic navigation systems, etc.
(5) Telecom: Cellular telephones, telephone switches, handset multimedia applications, etc.
(6) Computer peripherals: Printers, scanners, fax machines, etc.
(7) Computer networking systems: Network routers, switches, hubs, firewalls, etc.
(8) Healthcare: Different kinds of scanners, EEG, ECG machines etc.
(9) Measurement & Instrumentation: Digital multimeters, logic analysers PLC systems,
etc.
(10) Banking & Retail: Automatic teller machines (ATM) and currency counters, point of
PURPOSE OF EMBEDDED SYSTEM
(1) Data collection/Storage/Representation (2) Data
communication
PURPOSE OF EMBEDDED SYSTEM
(3) Data (signal) processing (4)
Monitoring(Knowing)
PURPOSE OF EMBEDDED SYSTEM
(5) Control (6) Application specific user
interfaces
A computer can be simplified down to the essential elements shown.

Data
Memory
The Central
Outside Input/
Processing
World Output
Unit (CPU)
Program
Memory

A computer made on a single integrated circuit is called a microprocessor.


Embedded Computer is
Microcontroller
Or
Microprocessor
The Microprocessor

1. ALU( Arithmetic Logical Unit): is used to perform arithmetic and logical


operations.

2. Registers: A register is just a collection of flip-flops. A flip-flop can only store one bit
so to handle 32 bits at a time we would need 32 flip-flops and would refer to this as a
32-bit register.

3. Instruction Register: is memory used to store instructions.

4. Instruction Decoder: The instruction decoder is the part of the microprocessor that
is able to actually carry out an instruction.

5. Buses: are communication lines


The Microcontroller

A microcontroller is a microprocessor designed primarily to perform simple control functions.


 It is also a microprocessor with I/O peripherals, memory and A/D Converter in a single chip.

Microcontrollers usually have these features

 low cost,
 physically small,
 input/output intensive, and capable of easy interfacing,
 limited memory capability for program and data,
 instruction set leading to compact code, with limited arithmetic capability,
 ability to operate in a real-time environment.

In certain applications the following further features are essential:

• ability to operate in hostile environment, e.g. high or low temperature, tolerant to electromagnetic
interference,
• low power, with features adapted to battery power.
Embedded
Computer is

Microcontroller
Or
Components
of Embedded
System
1. CPU
ALU( Arithmetic Logical Unit): is used to perform arithmetic and logical
operations.

Registers

 These elements of the microprocessor are programmable for data storage and
manipulations

 They are small memories within the µp

 Different registers are:

Accumulator: This has 8 bit capacity and performs arithmetic or logic operation and
stores results and data

• In addition there are 6 general purpose 8 bit registers that can be used by a
programmer for a variety of purposes.

• These are labeled as B, C, D, E, H, L. they can be used as individual registers when


operating on 8 bit data and can be used as pair when 16 bit data is to be stored

• When used as pairs the combination is B-C, D-E, H-L 36


Special Purpose Registers:
Specified by the manufacturer

1. Program counter (PC): is used to keep track of the address of the instruction in memory that has to be
executed next.
 It points to the address of the next instruction in the memory

2. Stack pointer abbreviated as SP: is a register known as stack pointer abbreviated as SP

 During the execution of a program,

 sometimes it becomes necessary to save the contents of certain registers because the registers
may be required to be used for some other operations in subsequent steps.

 These contents are moved to such locations using PUSH operations

 After completing these operations the saved contents are transferred back to the registers using POP
operations

 A set of memory locations are kept for this purpose which are known as stacks

 The last memory location occupied portion of the stack is called as ‘stack top’ and the SP holds the address
37
of the ‘stack top’
38
39
3. Status Register/Flags Register: The status
register, also known as the flags register, contains
individual flags or bits that reflect the status of the
processor or the outcome of arithmetic and logical
operations.
These flags can indicate conditions such as carry,
overflow, zero, negative, and others, which are used
for program control, conditional branching, and error
handling.
Further there are flip flops which act as status flags or status registers.
Each of these hold 1 bit flag that indicates certain conditions which arises
during arithmetic and logic operations. The status flags are:
i. Carry (CS) flag: This flag is set to ‘1’ whenever there is carry from addition
operation or borrow from a subtraction operation
ii. Zero (Z) flag: It is set to ‘1’ if the result of arithmetic or logic operation is
zero otherwise it is set to ’0’.
iii. Sign (S) flag: This is set to ‘1’ if most significant bit is one otherwise is ‘0’.
iv. Parity (P) flag: If no. of ‘1’s is even then this is set to ‘1’ if the no. of 1’s is
odd this is set to ‘0’
v. Auxiliary carry (AC) flag: Whenever a carry is generated from 3rd bit to 4th
bit during arithmetic operation AC flag is set to ‘1’
Example: 10011101
+ 11011001
= 101110110
There are 5 no. of 1’s hence P is set to 0
The result is non zero hence the Z is set to 0
There is a carry in the lost carry form hence CS is set to 1
The sign bit is ‘0’ hence S is set to 0 41
4. Instruction Register (IR):
 The instruction register is a register that holds the current
instruction being executed by the processor. It is responsible
for temporarily storing the fetched instruction before it is
decoded and executed.
5. Memory Address Register (MAR) and Memory Data
Register (MDR):
 These registers are used in the memory subsystem. The memory
address register holds the memory address being accessed,
while the memory data register temporarily stores the data
being read from or written to memory.
6. Control Registers:
 Control registers are used to configure and control various
aspects of the processor or system. They can include
registers that control memory management, interrupt handling,
cache settings, and system mode configuration.
7. Timer/Counter Registers:
2. Memory
Depending upon the type used we can classify memories into two groups:
Program memory and
Data memory.

• Program memory stores the program written by the programmer and


this memory is usually non-volatile, i.e. data is not lost after the removal of
power.

• Data memory is where the temporary data used in a program are stored
and this memory is usually volatile, i.e. data is lost after the removal of
power.
Memory Types

Memory : it is used to store information:


Basic concepts: Addressing and memory content
Types of Memory:
RAM
ROM
EEPROM
Flash
OTP
Read Only Memory (ROM)
 Read Only Memory (ROM) is used to permanently save the program being executed.
The size of program that can be written depends on the size of this memory. There are
several types of ROM.
Masked ROM (MROM)
 Masked ROM is a kind of ROM the content of which is programmed by the
manufacturer. The term ‘masked’ comes from the manufacturing process, where
regions of the chip are masked off before the process of photolithography.
One Time Programmable ROM (OTP)
 OTP ROM enables you to download a program into it, but, as its name states, one
time only. If an error is detected after downloading, the only thing you can do is to
download the correct program to another chip.
UV Erasable Programmable ROM (UV EPROM)
 It enables data to be erased under strong ultraviolet light. After a few minutes it is
possible to download a new program into it.
Flash Memory

 This type of memory was invented in the 80s in the laboratories of INTEL and was
represented as the successor to the UV EPROM. Since the content of this memory can
be written and cleared practically an unlimited number of times, microcontrollers
with Flash ROM are ideal for learning, experimentation and small-scale production. Because
of its great popularity, most microcontrollers are manufactured in flash technology today.

RANDOM ACCESS MEMORY (RAM)

 Once the power supply is off the contents of RAM is cleared. It is used for temporary
storing data and intermediate results created and used during the operation of
the microcontroller.

ELECTRICALLY ERASABLE PROGRAMMABLE ROM (EEPROM)

 The contents of EEPROM may be changed during operation (similar to RAM), but
remains permanently saved even after the loss of power (similar to ROM).
Accordingly, EEPROM is often used to store values, created during operation, which must be
3. Interrupts
 This is the command where MPU suspends the execution of
current program and jumps to a subroutine at a predetermined
location.
 There are two types of interrupts;
1. Non maskable interrupt
2. Software interrupt
 Non maskable interrupt forces the MPU to interrupt signal
unconditionally. For example in emergency situations such as
power failure.
 In software interrupt, the interrupt inputs are disabled by the
software. This is commonly used by I/O devices for data
communication. For example, while using a key board, after
pressing one key, the processor stays in the loop until another
47
4. BUS : a set of wires connecting the CPU with Memory. (8,16,24,32 bit …)
Data Bus : contains wires as wide as the memory content we want to read/write.
Address Bus : contains as many lines as the amount of memory we wish to address
Address bus: These are communication lines used to carry memory address and I/O
device address. Based on address line capacity, eg n-bit address line n = 8,16,…
 It can provide up to 2 n
no. Of memory locations.
 These are unidirectional lines i.e. the information flow is from µp to memory
locations.
Data Bus: The information, instructions, data and address are communicated with
outside world by transferring data in both directions.
 Address multiplexing: Thus a part of address and data are transmitted over a set of
shared lines. This is known as The ‘A-D’ bus transmits data/address at different
moments.
 At one particular moment it transmits either data or address, which is termed as time sharing
mode or multiplexing technique

Control bus: the generation of various signals and receiving of signals for
coordination and control of different operations pertaining to external devices is
the responsibility of the control bus. This can be categorized into i) Memory and I/O
49
lines and ii) CPU and bus control lines. Read, Write, Enable, Chip select
5. Input/output Unit (PORT) : block to interface the system with the outside world
The CPU treats the input/output ports just like any memory.
They can be Input port, Output port, Bidirectional port
6. Serial Communication: A protocol where one bit is transferred at a
time.
Used for communication between two devices on longer distances it is not
possible to use parallel connection. There are different types of serial
communication which are selected based on
• How many devices the microcontroller has to exchange data with?
• How fast the data exchange has to be?
• What is the distance between devices?
• Is it necessary to send and receive data simultaneously?
BAUD RATE
 The term baud rate is used to denote the number of bits transferred per
second [bps].
 It is usually required by the protocol that each byte is transferred along with
Serial Communication: A protocol where one bit is transferred at a time.
 I2C (INTER INTEGRATED CIRCUIT) : Inter-integrated circuit is a system for
serial data exchange between the microcontrollers and specialized
integrated circuits of a new generation.
 It is used when the distance between them is short (receiver and
transmitter are usually on the same printed board).
 Connection is established via two conductors. One is used for
data transfer, the other is used for synchronization (clock
signal)
SPI (SERIAL PERIPHERAL INTERFACE BUS):
A serial peripheral interface (SPI) bus is a system for serial communication which uses
up to four conductors, commonly three.
 One conductor is used for data receiving, one for data sending,
 one for synchronization and one alternatively for selecting a device to
communicate with.
 is a full duplex connection, which means that data is sent and received
simultaneously.
 The maximum baud rate is higher than that in the I2C communication system.
UART (UNIVERSAL ASYNCHRONOUS RECEIVER/TRANSMITTER):
This sort of communication is asynchronous, which means
that a special line for transferring clock signal is not
used.
 This feature is crucial. Since only one communication line
is used, both receiver and transmitter operate at the
same predefined rate in order to maintain necessary
synchronization
 It has the low speed.
7. Oscillator: Every pulse generated by the oscillator enable
harmonic and synchronous operation of all circuits within the
microcontroller. (XT, HS, RC)
It defines the clock cycle of the embedded system.
• LP low power crystals 32 kHz–200 kHz.
• XT crystal/ceramic resonator 100 kHz–4 MHz.
• HS high speed crystal/ceramic resonator 4 MHz–20 MHz.
• RC resistor/capacitor.
8. POWER SUPPLY CIRCUIT
There are two things worth attention concerning the microcontroller power supply circuit:
 Brown out is a potentially dangerous condition which occurs at the moment the
microcontroller is being turned off or when the power supply voltage drops to a
minimum due to electric noise. As the microcontroller consists of several circuits
with different operating voltage levels, this state can cause its out-of-control
performance. In order to prevent it, the microcontroller usually has a built-in circuit
for brown out reset which resets the whole electronics as soon as the
microcontroller incurs a state of emergency.
 Reset pin is usually marked as MCLR (Master Clear Reset). It is used for external
reset of the
microcontroller by applying a logic zero (0) or one (1) to it, which depends on the type
of the microcontroller. In case the brown out circuit is not built in, a simple external
circuit for brown out reset can be connected to the MCLR pin.
9. Timer: If it is necessary to measure time between two events, it is sufficient to
count up pulses generated by this oscillator. This is exactly what the timer does.
It is a counter which we can use to measure time, period and define protocol.
10. Watch Dog Timer : a counter where our program needs to write a zero in every
time it executes correctly. In case that program gets “stuck” , a zero will not be written
in and the counter alone will reset the microcontroller upon achieving its maximum
value.
11. Analog to Digital Converter: This part is responsible for converting
analog signal to digital form and pass it along to the CPU.
Based on The internal Architecture,

Microcontrollers are divided in to two.

1.Von-Neuman Architecture

2.Harvard Architecture
VON-NEUMAN ARCHITECTURE

 Microcontrollers using von-Neumann architecture


have only one memory block and one 8-bit
data bus.
 As all data are exchanged through these 8 lines,
the bus is overloaded and communication is
very slow and inefficient.
 The CPU can either read an instruction or
read/write data from/to the memory.
a) The Von Neumann Way
 Both cannot occur at the same time
since instructions and data use the same bus.
HARVARD ARCHITECTURE

Microcontrollers using Harvard architecture have two

different data buses.

 One is 8 bits wide and connects CPU to RAM.

 The other consists of 12, 14 or 16 lines and connects

CPU to ROM. Accordingly, the CPU can read an

instruction and access data memory at the

same time.

b) The Harvard Way


Address

Data Data
Memory Memory
Data
Address
Central Address
Input/ Central
Processing Input/
Unit (CPU) Output Processing
Data Output
Unit (CPU) Data
Address
Program
Memory Program
Memory
Data

a) The Von Neumann Way b) The Harvard Way


What can the Computer Actually Do? - Instructions and Instruction Sets

A computer “executes” instructions in its Arithmetic Logic Unit (ALU), running through a series of
instructions called a program. An ALU can only do a few things, but it can do them very fast. A typical 8-
bit ALU can do the list shown below. A is the “Accumulator”, a digital register where the computations
actually occur, and M is a location in memory. The ALU in turn forms part of the Central Processing Unit
(CPU).
Increment A A = A plus 1
Decrement A A=A-1
Add A to M A = A plus M
Subtract M from A A=A-M
AND A with M A = A.M
OR A with M A=A+M
Exclusive OR A with M A = A+ M
Shift A left A = 2A
Shift A right A = A/2
Rotate A left
Rotate A right
Complement A A = NOT A
Clear A A=0
How Instruction Sets are Made: the “CISC” Machine

Any CPU has a set of instructions that it recognizes and responds to ; all programs are
built up in one way or another from this instruction set. We want computers to execute code as fast as
possible, but how to achieve this aim is not always an obvious matter.

One approach is to build sophisticated CPUs with exotic instruction sets, with an instruction ready for
every foreseeable operation. This leads to the CISC, the Complex Instruction Set Computer. A CISC has
many instructions, and considerable sophistication. Yet the complexity of the design needed to achieve this
tends to lead to slow operation. One characteristic of the CISC approach is that instructions have
different levels of complexity. Simple ones can be expressed in a short instruction code, say one byte of
data, and execute quickly. Complex ones may need several bytes of code to define them, and take a long
time to execute.

A CISC machine is generally recognised by:


• Many instructions (say over one hundred), some with considerable sophistication;
• Instruction words are of different length;
• Instructions take different lengths of time to execute.
How Instruction Sets are Made: the “RISC” Machine

Another approach is to keep the CPU very simple, and have a limited instruction set. This leads to the
RISC approach – the Reduced Instruction Set Computer. The instruction set, and hence overall design, is
kept simple. This leads to fast operation. One characteristic of the RISC approach is that each instruction is
contained within a single binary word. That word must hold all information necessary, including the
instruction code itself, as well as any address or data information also needed. A further characteristic, an
outcome of the simplicity of the approach, is that every instruction normally takes the same amount of
time to execute.

A RISC machine is generally recognised by:


• Few instructions (say well below one hundred),
• Each performs a very simple action;
• All instructions are single word;
• All, or almost all instructions take the same length of time to execute.
Instruction cycle
An instruction(Program) is a command given to the computer to perform
certain specific operation on given data.

To perform a particular task, the programmer writes sequence of


instructions known as program

Program and data are stored in the memory.

The CPU fetches one instruction from the memory at a time and
executes it in series to produce the final result.

The necessary steps that a CPU carries out to fetch an instruction and
necessary data from memory and execute it, constitutes an instruction
cycle which consists of two parts, viz. fetch cycle and execute cycle
67
 In fetch cycle the CPU fetches opcode from memory
 During execute cycle, CPU gets data from memory to perform the specific
operation which is specified in the instruction
 The time required to fetch opcode is fixed while the execution of the instruction
varies on the type of the instruction.
 Hence the total time required execute an instruction cycle is
IC = FC + EC

68
 The first byte of an instruction is its opcode. The instruction may be more than one
byte long.
 The other bytes are operands and address
 In the beginning of the fetch cycle, the content of the Program counter (PC) which is
the address of the memory location where opcode is available is sent to memory.
 The memory places the opcode on the data bus so as to transfer it to the CPU.
 The entire operation of fetching an opcode takes three clock cycles

69
Execute operation

 The opcode fetched from the memory goes to the data register/ data buffer then to
instruction register, IR.

 From IR it goes to decoder where it is decoded.

 After decoding, execution begins.

 If the operand is in general purpose registers, execution is immediately performed


which is one clock cycle.

 If the instruction has data and address which are in the memory, then the CPU has to
perform some READ operation to get the desired data.

 The READ cycle is similar to fetch cycle.

 In some instructions, WRITE operation is performed

 In WRITE cycle data is sent from the CPU to the memory or an I/O device. 70
Machine cycle
 The instruction cycle consists of opcode fetch followed by an execute cycle.
 The execute cycle itself consists of none or more fetch cycle like READ / WRITE
operation.
 All these operations are performed in different time slots known as machine
cycles
 An opcode is fetched in first machine cycle
 Additional machine cycles are needed to read data from or to write data
to memory or I/O devices

71
Architec
tures
8086
Micro-

You might also like