0% found this document useful (0 votes)
8 views

Embedded

Uploaded by

amoorzain54
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)
8 views

Embedded

Uploaded by

amoorzain54
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/ 4

Embedded

Analogue: Represented by a continuous function


Digital: Represented by a discrete set of values defined at specific instances of the input domain (time/space or
both)
-Computers are built out of device that store and operate on bits(byte=8 bits).
-Bits are data units that can only have one of two values (0/1-t/f).
Binary system: uses 0 and 1 to represent data, can be converted into decimal and hexadecimal for easier
readability and also Used to present chars.
Cycle, frequency and period
-Frequency (f): The number of cycles per second, measured in Hertz (Hz).
A cycle is the basic shape of a waveform that repeats.
-Period (T): The time taken to complete one cycle of a sinewave.
-T = 1/f (Period is the reciprocal of frequency).
• Sinewave equation:
y(t)=A⋅sin⁡(2πft+ϕ)y(t) = A \cdot \sin(2\pi f t + \phi)y(t)=A⋅sin(2πft+ ϕ)
Or: y(t)=B⋅cos⁡(ωt+θ)y(t) = B \cdot \cos(\omega t + \theta)y(t)=B⋅cos(ωt+θ)
o y(t): Displacement or amplitude at time ttt.
o A: Amplitude.
o f: Frequency.
o ω (omega): Angular frequency (measured in radians/second).
▪ ω=2πf=2πT\omega = 2\pi f = \frac{2\pi}{T}ω=2πf=T2π .
o φ (phi): Phase.
o (2πft + φ): Angle that grows over time, measured in radians.

Signal representation domain


Spectrum: 2D representation of a signal in the frequency domain (frequency vs. magnitude).
Waveform: 2D representation of a signal in the time domain (time vs. magnitude).
Spectrogram: 3D representation of a signal (time vs. frequency vs. magnitude).

Digitization comprises two operations


1.Sampling
is the process of measuring a continuous signal at discrete intervals, converting it into a
sequence of equally spaced values.
2-Quantization
involves mapping a large set of input values to a smaller set by rounding them to a defined precision, effectively
"chopping off" values to fit specific levels.

Digital signal: -Sampled ,quantized, Discrete values.


Analogue to digital conversion(ADCs): The process is normally carried out by special hardware device called
Analogue to digital converters.
Digital to Analogue conversion: The reverse is performed by a Digital to Analogue converter.

Digital Filters: A digital filters takes a digital signal as input & produces another signal with certain
characteristics removed
Sampling Rate (Ts) : is the number of samples in a fixed amount of time or space taken from continuous
signal to make a discrete signal.
-Sampling criteria means sampling frequency Fs must satisfy: Fs >=2Fmax where Fmax is the maximum
frequency of composite input signal.
Lec2
Memory:
-Stores binary data for a specific time.
-It can be read and/or written via the Data Path, Address Path, Control Path.
-Reading and writing are controlled using the control path (CE, RE, WE).
-memory consists of locations Each location is selected by an address and holds
specific data.
Access Methods
Read-Only Memory (ROM): Nonvolatile, random access, read-only.
Read/Write Memory (RAM): Volatile, allows reading and writing.
Data Retention Methods
Volatile Memory: Loses data when power is off (RAM).
Nonvolatile Memory: Retains data without power (ROM, FLASH, EEPROM, magnetic disks).

Types of ROM (Non-volatile & Random Access)


Read-Only Memory (ROM)
-Read-only, Implemented as a combinational circuit.
-Stores data in the circuit's structure and connections.
Programmable ROM (PROM)
-Read-only, programmable once.
-Sensitive to static electricity, which can change bits from 1 to 0.
Erasable Programmable ROM (EPROM)
-Rewritable, Uses floating gate transistors and can be erased using ultraviolet light.
Electrically Erasable Programmable ROM (EEPROM)
-Rewritable, Similar to ROM but uses floating gate transistors.
-Can be erased by applying an electric field.
Flash EEPROM
-Rewritable, made of EEPROM.
-Sector-addressable (groups of bytes).
-Includes NAND and NOR flash types.

Random Access Memory (RAM)


Static RAM (SRAM): Faster than DRAM, consumes less power, uses more transistors per bit, and is more expensive. Commonly
used in cache memory.
Dynamic RAM (DRAM): Cheaper than SRAM, used in main memory, requires periodic refreshing.

Memory Registers: A register is a storage device capable of holding binary data, best viewed as a collection of flip-flops
(usually D flip-flops). To store N bits, a register must have N flip-flops, one for each bit to be stored.

CPU Components
Arithmetic Logic Unit (ALU): Performs all arithmetic and logic operations required by the CPU.
Control Unit (CU): Selects the required operations and determines data source and destination registers.
Registers:
1-User Accessible Registers: Read or written by machine instructions.
Accumulator: Stores intermediate results of arithmetic and logic operations, reducing the need to access main memory.
Address Registers: Hold addresses for indirect access to primary memory (e.g., Index Register, Stack Pointer).
General Purpose Registers (GPRs): Combined data/address registers, sometimes including floating-point support.
Special Purpose Registers (SPRs): Have specific functionalities, such as:
1-Status Register: Holds program status.
2-Program Counter: Holds the address of the next instruction to be executed.
2-Internal Registers: Not accessible by instructions, used for internal processor operations.
Instruction Register (IR): Holds the instruction currently being executed.
Memory Buffer Register (MBR): Stores data being transferred to and from immediate access storage,
preparing it for the next cycle.

Accessing External Memory in 8051


I/O Lines: The 8051 uses 16 I/O lines for external memory access.
Port 0: Sends the lower-order address when the ALE (Address Latch Enable) signal is high.
Acts as an input port for data transfer from the corresponding memory.
Port 2: Sends the higher-order address.
Memory Addressing:
-External data memory can have addresses that are either one or two bytes long.
For 64K memory, all bits of Port 2 are used for the higher-order address.
For 32K memory, only 7 bits of Port 2 are needed.
For 16K memory, only 6 bits are required.

Lec3
The Basic Architecture of the Computer Systems or Embedded Systems

The Basic Architecture of the Computer Systems or Embedded Systems

It has single path with its memories It has dual paths with its memories
Likes microprocessor 8086, i9 Likes the most microcontrollers such as 8051, AVR

Microprocessor (µp): is a CPU in a single integrated microchip.


It has 3 major units: 1-Arithmetic Logic Unit (ALU) 2-Group of registers 3-Control Unit (CU).
Microcontroller (µC): is a CPU in a single integrated microchip in addition of :
1- Data Memory(RAM) 2-Program Memory 3-Data Ports 4-Timers 5-ADC&DAC 6-PWM
Example of microcontrollers
-The AT89C51 is member of the MCS-51 Microcontrollers family ,designed by Intel corporation ,fabricated by Atmel
and more than 20 corporations.

8051 microcontroller: is widely used in embedded systems, aerospace, robotics, automotive, security, and industrial
control due to its low cost, small size, and ease of programming. It is an 8-bit microcontroller with an 8-bit data bus and
features a CISC architecture along with Harvard architecture, meaning it has separate program and data memory,
making it ideal for various applications where space and efficiency are crucial.

External access pin to select either the internal or external program memory
Address latch enable pin to separate the address bus from the address/data bus.
Program strobe enable pin to connect with the chip select (CS) pin of external ROM.
Types or resetting:
1- Automatic restarting
After Powering-on the 8051, positive pulse (with time duration > 2 machine cycles) will apply to pin “pin 9”.
2- Manual restarting
After pressing the push-button, positive pulse will apply to reset-pin “pin 9”.
Important note the PC will load by random address in case powering-on MC without resetting therefore the
CPU will start fetching any random instruction from the program memory.
Lec 4
Assembler: A SW tool that converts assembly language into machine code (binary) that a computer's processor can
execute.
Assembly Language: Human-readable instructions that correspond to machine code, allowing programmers to write
code that is easier to understand and manipulate.
Emulator: A combination of hardware and software used to run programs and test/debug external systems.
Linker: A program that combines several object files into one. It produces a link file (with a .EXE extension) and a link
map file (with a .MAP extension) that contains address information for the linked files.
Debugger: A tool that allows you to load and troubleshoot object code programs, especially when they don't require
external hardware.
Locator : A program that assigns specific memory addresses to segments of object code, converting .EXE files to .bin
files with physical addresses.

Assembler Instructions:
• DW (Define Word): Reserves memory for words (16-bit), e.g., WORDS DW 1234H.
• ORG (Origin): Sets the start address for the current machine code, e.g., ORG 0.
• END: Marks the end of the assembly code; any instructions after this are treated as comments.
• EQU (Equate): Assigns a label to a constant value or symbol, improving code readability and
maintainability. Example: MAX_VALUE EQU 255 assigns the label MAX_VALUE to the value 255.

Assembly Language vs. Machine Code: Assembly language is designed for human readability and manipulation,
while machine code is executed directly by the computer.
Assembler Instructions vs. Directives: Assembler instructions generate machine code and contribute to program
size, while directives do not create machine code and serve to control the assembly process.

Internal Clock Pulse:Used by the CPU to synchronize all processes in microcontrollers.


Machine Cycle (MC): The minimum number of clock pulses (CPs) required by the CPU to complete a single
instruction cycle, typically 12 CPs, encompassing Fetch, Decode, and Execute phases.
Execution Time: The time taken by the CPU to carry out a single instruction.
Run-time (Delay-time); is the time taken to execute a program or subprogram.
The Program Counter (PC) points to the memory location of the current instruction being fetched.

Machine Cycle Rate=Crystal Frequency /12


Delay Time=Total Machine Cycles / Crystal Frequency
The Program-Status-Word (PSW) register contains:
1- 4 status flags: CY (Carry), AC (Auxiliary Carry), OV (Overflow), P (Parity),
Parity flag (P): if the number of 1's in the result is even (P=0) or odd (P=1).
2- 2 control flags: RS0, RS1,
3- 1 user bit-addressable flag: F0,
4- 1 reversed flag (bit 1).

the Overflow flag (OV) is set (OV=1) in three cases:


1-Division by zero,
2-Multiplication result exceeding the 8-bit range (greater than FFh),
3-When addition or subtraction of signed numbers exceeds the range of -128 to 127.

You might also like