Embedded System
Embedded System
Embedded Systems
Introduction:
System
For example, a watch is a time displaying system. Its components follow
a set of rules to show time. If one of its parts fails, the watch will stop
working. So we can say, in a system, all its subcomponents depend on
each other.
Embedded system (ES)
An embedded system can be thought of as a computer hardware system
having software embedded in it (CPU, RAM, ROM, I/O Ports, and Timers
are components to be embedded together on a single chip). An embedded
system can be an independent system or it can be a part of a large system.
An ES is a microcontroller based system which is designed to perform a
specific task. For example, a fire alarm is an embedded system, it will
sense only smoke.
*) Instruction categories: -
-
1. Arithmetic, logic, and shift instructions (INC, DEC, ADD, SUB,
MUL, DIV, AND, OR, XOR, SHR, SHL);
2. Instructions for moving information to and from memory and
processor registers (MOV, LDA, STA, PUSH, POP);
3. control instructions (JMP (BUN), JZ, JNZ, SKI, SKO, CALL
(BSA), RET);
4. Input / output (I / O) instructions (INP, OUT).
- The DUP (…) pseudo – op: is used to multiple the store of the same
value in memory (data segment).
- The ORG (origin) pseudo – op: It tells MASM to reach the required
offset address.
compiling
Program instruction (add AX , BX) ------------- machine instruction
* Instruction fields:
3
Instruction fields:
- Op code field (operation part): is a group of bits that specifies the
operation such as add, sub, mul, shift, complement, … . If op. code
contains n bits, then it is capable of representing 2 n different operations.
- Mode field - specifies the way the operand or the effective address is
determined.
* Addressing modes:
tafser
Specifies a rule for interpreting the address field of the instruction before
the operand is actually referenced.
* General registers:
processing register to hold one of the operands and to store the result .
6- The temporary register (TR): to hold temporary data during
Processing.
7- The input register (INPR): receives an 8-bit character from an
input device.
8- The output register (OUTR): holds an 8-bit character for an
output device.
*) Modes of transfer:
1- Programmed I / O ;
2- Interrupt I / O ;
1- Programmed I / O:
2- Interrupt I / O:
Types of interrupts:
a- Hardware interrupts (external): come from I / O devices, timing
device, power supply, … etc.
b- Software interrupts (internal): come from error conditions such as
register overflow, divide by zero, stack overflow, … etc., and from
call instruction.
6
3- DMA:
During DMA the CPU is idle (doesn't use memory buses) and has no
control of the memory buses. DMA controller takes over the buses to
manage the transfer directly between I / O device and memory (removing
the CPU from the path).
7
EMBEDDED COMPUTERS
Image Courtesy of
Recording Connection of Canada
ES - Overview
ES – Microprocessor and Microcontroller Architecture
ES - 8051 Microcontroller
ES - I/O Programming
ES - Assembly Language
ES - Registers
ES - Registers Bank/Stack
ES - Instructions
ES - Addressing Modes
ES - Timer/Counter
ES - Interrupts
The rotating drum of the Washing Machine starts rotating and that’s
how washing starts.
After washing cycle, the outlet valve opens to release all the dirty
water.
The sensor detects whether all the dirty water has been removed or
not and opens or close the outlet valve.
This whole process repeats and we get our clothed washed. # #
2. Data processing (compare entered data with the value in the control
program);
Microcontroller
A microcontroller is a single-chip VLSI unit, which although having
limited computational capabilities, possesses enhanced input/output
capability and a number of on-chip functional units.
Microprocessor Microcontroller
CPU, RAM, ROM, I/O Ports, and CPU, RAM, ROM, I/O Ports, and
Timers are components on Timers are components to be embedded
different chips and can vary in together on a single chip and are fixed in
numbers. numbers.
The following pin diagram shows the details of the 40 pins. In 8051, I/O
operations are done using four ports, where each port has 8 pins (32 pins).
The other 8 pins are designated as Vcc (power supply), Vss (GND: ground),
XTAL1, XTAL2 (crystal-frequency), RST (reset), EA (external access),
ALE / PROG (address latch enable), and PSEN (program store enable).
It is a 40-Pin PDIP (Plastic Dual Inline Package):
16
Single-Bit Instructions
Instructions Function
JBC bit, target jump to target if bit = 1, clear bit (jump if bit, then clear)
21
22
23
24