Lesson 1 Introduction to Embedded Systems Development
Lesson 1 Introduction to Embedded Systems Development
Embedded Systems
Definition: An embedded system is a specialized computing system that performs
dedicated functions or tasks within a larger mechanical or electrical system. It typically
consists of hardware and software designed to perform specific control, monitoring,
or data processing tasks.
Components:
o Hardware: Includes microcontrollers, processors, sensors, actuators, and other
peripheral devices.
o Software: The firmware or embedded software that operates the hardware
and performs specific functions.
Characteristics:
o Real-Time Operation: Often required to respond within strict time constraints.
o Resource Constraints: Limited processing power, memory, and power
consumption.
o Integration: Embedded systems are usually integrated into larger systems (e.g.,
automotive control systems, household appliances, medical devices).
Examples:
Page 1 of 19
o Programming: Writing code in languages suited for embedded systems,
typically C or C++, and sometimes assembly language.
o Testing and Debugging: Ensuring that the software functions correctly under
various conditions and meets performance requirements.
o Deployment: Installing the software onto the embedded hardware and
ensuring it operates as intended.
Characteristics:
o Development Environment: Often involves specialized tools and environments
for coding, debugging, and testing (e.g., IDEs, simulators).
o Real-Time Constraints: Must meet timing requirements and handle concurrent
tasks efficiently.
Examples:
o Firmware for microcontrollers in consumer electronics
o Software for automotive safety systems
o Control software for industrial automation systems
Key Differences
Page 2 of 19
Dedicated Functionality: Embedded systems are designed for specific tasks, such as
controlling a washing machine, reading temperature data from a sensor, or running a
smart thermostat.
Real-time Operations: Many embedded systems operate in real-time, meaning they
must process inputs and respond within a strict time constraint.
Resource Constraints: Embedded systems often have limited resources (e.g.,
processing power, memory, storage), so software must be optimized for efficient use
of resources.
Interaction with Hardware: Embedded systems interact directly with hardware
through sensors, actuators, displays, and other devices.
2. Key Components of an Embedded System:
An embedded system consists of several key components, which work together to perform
the system's desired tasks:
Microcontroller (MCU): The central processing unit (CPU) of the embedded system,
which handles the execution of code. A microcontroller contains a processor, memory,
and peripheral interfaces all in one package.
Memory: Embedded systems have both volatile memory (RAM) and non-volatile
memory (e.g., Flash) to store programs and data.
Sensors and Actuators: Sensors collect data from the physical world (e.g.,
temperature, pressure), and actuators are responsible for controlling physical
components (e.g., motors, relays, lights).
Input/Output Devices: These include displays (LCDs, LEDs), buttons, touchscreens,
etc., that allow the system to interact with users and other systems.
Communication Interfaces: Embedded systems often communicate with other
devices using protocols such as UART, SPI, I2C, CAN, and more.
3. Types of Embedded Systems:
Embedded systems can be classified into several categories based on complexity, processing
power, and application.
Small-scale Embedded Systems: These systems are typically low-cost, simple, and
have minimal resources. Examples include home appliances like washing machines,
microwaves, and coffee makers.
Medium-scale Embedded Systems: These systems are more complex and have more
processing power. Examples include digital cameras, printers, and automotive systems.
Page 3 of 19
4. Applications of Embedded Systems:
Embedded systems are used in a wide range of applications, including:
Consumer Electronics: Smartphones, smart TVs, washing machines, and microwave
ovens.
Automotive Systems: Anti-lock braking systems (ABS), engine control units (ECUs),
airbag systems.
Page 4 of 19
1. 8051 Architecture (by Intel)
The 8051 microcontrollers, originally developed by Intel in 1980, has become a widely
used architecture in embedded systems. It is an 8-bit microcontroller designed for
control applications.
Key Features of the 8051 Architecture:
8-bit Processor: The 8051 processes 8-bit data.
Memory:
o ROM (Program memory): 4KB (in the original version).
o RAM (Data memory): 128 bytes (in the original version).
o Special Function Registers (SFRs): Controls specific functions, like timers, I/O,
etc.
Registers: Includes 4 general-purpose registers (R0 to R3) and 8-bit accumulator (A), B
register, and data pointer (DPTR).
Timer/Counter: Two 16-bit timers.
I/O Ports: 4 parallel I/O ports, each 8 bits wide.
Page 5 of 19
Key Features of AVR Architecture:
8-bit Processor: Operates on 8-bit data.
Harvard Architecture: Separate memory spaces for program and data, enabling faster
operation.
Registers: Includes 32 general-purpose registers (R0 to R31), an accumulator, and a
status register.
Memory:
o Flash: Typically 16KB to 256KB (program memory).
o SRAM: 512B to 8KB (data memory).
o EEPROM: Used for non-volatile data storage (1KB to 4KB).
Timers: Multiple 8-bit and 16-bit timers for generating delays, PWM, etc.
Page 6 of 19
RISC Architecture: PIC uses a Reduced Instruction Set Computing (RISC) architecture,
which makes it fast and efficient.
Memory:
o Flash: Varies from 1KB to 256KB for program storage.
o RAM: Typically 128B to 4KB.
Applications:
Embedded control in appliances, vehicles, and robotics.
Communication devices and sensors.
Simple microcontroller applications in education and hobby projects.
Page 7 of 19
o Cortex-A: Designed for applications that require high-performance processing
(e.g., smartphones, tablets).
o Cortex-R: Designed for real-time applications with deterministic processing.
Memory:
o Flash: Typically 64KB to several MB.
Interrupt System: ARM provides an advanced interrupt system with a Nested Vector
Interrupt Controller (NVIC).
Clock Speed: Can run from 100 MHz to 1 GHz or higher (especially in Cortex-A series).
Advantages:
High-performance processing with lower power consumption.
Wide range of cores, allowing it to scale from low-power, low-cost systems to high-
performance systems.
Excellent ecosystem and developer tools.
Comparison Table:
Page 8 of 19
Feature 8051 AVR PIC ARM Cortex
8-bit, 16-
8-bit,
Architecture 8-bit bit, 32-bit, 32-bit RISC
Harvard
RISC
Flash,
4KB ROM, Flash, RAM, Flash, SRAM,
Memory SRAM,
128B RAM EEPROM EEPROM
EEPROM
Up to 12 8MHz to Up to 20
Clock Speed Up to 1 GHz
MHz 20MHz MHz
Harvard RISC,
Simple, 111 RISC, wide set
Instruction Set architecture, simple
instructions of instructions
simple CISC instructions
Consumer Consumer
Simple Robotics,
electronics, electronics,
Applications control home
control automotive,
systems automation
systems IoT
The process of developing an embedded system involves several steps, which typically
include:
1. Requirement Analysis:
o Identify the purpose and functionalities of the embedded system.
o Understand constraints such as size, power consumption, cost, and
performance.
2. System Design:
o Hardware design: Select a microcontroller, peripherals, sensors, and actuators.
Page 9 of 19
o Software design: Write firmware that runs on the microcontroller to control
the system.
3. Programming and Coding:
o Embedded programming is typically done in C, C++, or assembly language.
o Use of specialized IDEs (e.g., Keil, MPLAB X, Arduino IDE) to write, compile,
and debug code.
Real-time Constraints: The system must process inputs and generate outputs within
strict time limits.
Memory and Storage Limitations: Embedded systems have limited memory, so code
and data must be optimized.
Debugging and Testing: Debugging embedded systems can be more challenging than
debugging standard software because the code interacts with physical hardware.
Security: As embedded systems are used in critical applications, securing them from
vulnerabilities is important.
8. Tools Used in Embedded Systems Development:
To develop embedded systems, engineers use various tools and software:
Integrated Development Environments (IDEs): Examples include Keil (for ARM and
8051), MPLAB X (for PIC), Arduino IDE (for Arduino boards).
Page 10 of 19
Compilers: To convert high-level code into machine code (e.g., GCC for ARM or IAR
Embedded Workbench).
Simulation Software: Such as Proteus, TINA-TI, or ModelSim for circuit simulation.
Debugging Tools: JTAG debuggers, Logic analyzers, and oscilloscopes to troubleshoot
hardware and software.
9. Key Concepts in Embedded System Development:
Real-time systems: Embedded systems often need to perform tasks within specific
time constraints.
Interrupts: A mechanism for interrupting normal execution to handle urgent tasks like
time-critical I/O.
Page 11 of 19
Feature Description
ROM 4 KB internal ROM// built-in for storing the program code (firmware)
Page 12 of 19
Feature Description
128 bytes of RAM// used to store temporary data, variables, and workspaces
RAM
during program execution.
4 x 8-bit I/O ports (32 I/O pins)// The 8051 provides 4 I/O ports, each 8 bits
wide, giving a total of 32 I/O pins. These ports are used to interface the
I/O Ports
microcontroller with external devices like LEDs, switches, sensors, etc. The
microcontroller can read inputs and send outputs via these I/O pins.
2 x 16-bit timers and counters// used for generating time delays, measuring
Timers/Counters intervals, counting external events, or controlling periodic tasks. These timers
can also be configured as counters to count external pulses or events.
Serial
Full-duplex UART for serial communication
Communication
Power
Moderate, suitable for low-power applications
Consumption
External Memory
Yes, supports external memory expansion
Support
Special Function
Configurable SFRs for peripheral control
Registers
Bit-Addressable
128 bytes of bit-addressable RAM
RAM
Page 13 of 19
The pin diagram of 8051 microcontroller consists of 40 pins as shown below. A total of 32 pins
are set away into four Ports such as P0, P1, P2 and P3. Where, each port contains 8 pins.
1. Port 0: Bidirectional data transfer and lower address bus.
2. Port 1: General-purpose I/O for interfacing.
3. Port 2: Higher byte of the address bus.
4. Port 3: Multipurpose I/O with control functions.
5. Port 4: Not defined in 8085 architecture.
1. Port 1 (P1.0 - P1.7) // P1.1 refers to the second pin of Port 1
Function: General-purpose Input/Output (I/O) pins.
Analysis: These pins can be configured as either input or output, making them flexible
for various purposes like interfacing with switches, sensors, or external devices.
Example: P1.0 can be used to read a switch. When the switch is pressed, it reads a low
signal (0V), indicating the switch is on. This is a typical application in embedded
systems for reading digital inputs from physical switches.
Page 14 of 19
2. Reset (RST)
Function: Active-high reset pin.
Analysis: This pin is used to reset the microcontroller. When it is held high for a brief
period during power-up, it clears registers and resets the program counter, ensuring
the microcontroller starts from a known state.
Example: RST ensures that the microcontroller initializes properly during startup,
clearing any residual data or instructions from previous operations. This is crucial for
system stability.
3. Port 3 (P3.0 - P3.7)
Function: General-purpose I/O with special functions.
Analysis: Port 3 pins can serve multiple specialized functions, such as serial
communication Universal Asynchronous Receiver/Transmitter (UART), interrupt
handling, and external memory interfacing. This adds versatility to the 8051 for various
peripheral connections.
Example: P3.0 (RXD) is used for receiving serial data (e.g., from a computer via UART).
This pin is essential for communication, especially in IoT and embedded systems where
serial communication is commonly used for data exchange.
4. Crystal Oscillator Pins (XTAL1 and XTAL2) ( pin 18-19)
5. Ground (GND)
Function: Ground connection for the power supply.
Analysis: This pin serves as the common reference point for the microcontroller and
other components in the system. It is essential for ensuring that the entire system
shares the same ground, preventing signal inconsistencies and ensuring stable
operation.
Example: All components connected to the 8051 microcontroller, including sensors,
displays, and actuators, must share the GND to ensure proper signal levels and reliable
communication between devices.
6. Port 2 (P2.0 - P2.7)
Page 15 of 19
Function: General-purpose I/O and higher byte of the address bus.
Analysis: Port 2 serves two purposes: as general-purpose I/O pins and as part of the
address bus for external memory interfacing. This dual function allows the
microcontroller to interact with both external devices and memory.
Example: When interfacing with external memory, Port 2 provides the higher bits of
the address, enabling the microcontroller to address a larger range of memory (e.g.,
external RAM). This is key when external memory is required for larger data storage in
embedded systems.
7. Address Latch Enable (ALE)
Function: Signals the demarcation between address and data during external memory
operations.
Analysis: ALE is a control signal that helps manage the external memory operations by
distinguishing between address and data information. This is essential when dealing
with external memory, ensuring correct data fetching and writing operations.
Example: When accessing external memory, ALE goes high, signaling that the current
data on Port 0 and Port 2 represents an address, not data. This ensures the correct
interpretation of memory addresses and data.
8. Program Store Enable (PSEN)
Function: Used to read external program memory.
Analysis: PSEN is an important pin for accessing external program memory (ROM). It
is activated when the 8051 is fetching instructions from external ROM or Flash
memory, enabling the execution of larger programs that exceed the microcontroller's
internal memory capacity.
Example: When executing code from external ROM, PSEN is activated to allow the
microcontroller to fetch program instructions.
9. External Access Enable (EA)
Example: If the system requires more program memory than the microcontroller’s
internal ROM can provide, EA can be set low to access external ROM.
10. Port 0 (P0.0 - P0.7)
Function: General-purpose I/O and lower byte of the address/data bus.
Page 16 of 19
Analysis: Port 0 serves a dual purpose as both general-purpose I/O and as the lower
byte of the address and data bus when interfacing with external memory. This enables
the 8051 to address and transfer data to/from external memory.
Example: Port 0 can be used for transmitting data or receiving addresses in external
memory operations. For example, it may transmit data to an external EEPROM during
read or write operations.
11. Power Supply (VCC)
Function: Connects to the positive power supply (+5V).
Analysis: The VCC pin is responsible for powering the 8051 microcontroller. It must be
connected to a stable 5V power source to ensure the microcontroller operates
correctly and performs all functions as intended.
Example: If VCC is not properly supplied, the microcontroller will not function, and no
operations will take place. A stable power supply is crucial for reliable system
performance.
Page 17 of 19
1. Arithmetic Logic Unit (ALU)
Function: Performs arithmetic and logical operations.
Operations: Includes addition, subtraction, AND, OR, NOT, etc.
Role: It processes the data and executes instructions sent from the control unit.
2. Registers
Types:
General Purpose Registers (B, C, D, E, H, L):
Function: Hold data temporarily for processing.
Accumulator (A):
Function: A special register used for arithmetic and logic operations.
Role: Stores the result of operations and acts as a primary register for
data manipulation.
Program Counter (PC):
Function: Holds the address of the next instruction to be executed.
Page 18 of 19
Function: Generates timing signals.
Role: Determines the speed of operations in the microprocessor. The clock frequency
affects how quickly the processor can execute instructions.
6. Memory Interface
Function: Connects the microprocessor to memory (RAM and ROM).
Role: Manages data transfer between the CPU and memory, allowing the CPU to read
from and write to memory locations.
7. Input/Output Interface
Function: Facilitates communication with external devices.
Role: Handles data transfer between the microprocessor and peripherals (like
keyboards, displays, and sensors).
8. Address Bus
Function: Carries the address of the memory location to be accessed.
Role: The 8085 has a 16-bit address bus, allowing it to address up to 64KB of memory.
9. Data Bus
Function: Transfers actual data between the microprocessor, memory, and I/O devices.
Role: The 8085 has an 8-bit data bus, which means it can transfer data in 8-bit chunks.
Page 19 of 19