Embedded Systems Notes
Introduction to Embedded Systems
What is an Embedded System?
- An embedded system is an electronic/electro-mechanical system designed to perform a specific function.
- It is a combination of both hardware and firmware (software).
- Every embedded system is unique, and the hardware as well as the firmware is highly specialised to the application domain.
General Computing Systems vs. Embedded Systems
| Criteria | General Purpose Computing System | Embedded System |
|---|---|---|
| Contents | Combination of generic hardware and a General Purpose Operating System (GPOS) for various applications. | Combination of special-purpose hardware and embedded OS for a specific set of applications. |
| OS | Consists of a General Purpose Operating System (GPOS). | May or may not contain an Operating System for functioning. |
| Alterations | Applications are alterable (programmable) by the user. | Firmware is pre-programmed and non-alterable by the end user. |
| Key factor | Performance is the key deciding factor; faster is better. | Application-specific requirements (performance, power, memory usage) are key. |
| Power Consumption | More | Less |
| Response Time | Not critical | Critical for some applications |
| Execution | Need not be deterministic | Deterministic for certain types of ES like ‘hard real Time’ Systems. |
Classification of Embedded Systems
Criteria for classification:
- Based on generation
- Complexity and performance requirements
- Based on deterministic behaviour (for ‘Real Time’ systems)
- Based on triggering
Classification Based on Generation
- This is based on the evolution of embedded processing systems.
- First Generation: 8-bit microprocessors and 4-bit microcontrollers. Examples: Digital telephone keypads, stepper motor control units.
- Second Generation: 16-bit microprocessors and 8 or 16-bit microcontrollers. Instruction sets were more complex and powerful.
- Third Generation: 32-bit processors and 16-bit microcontrollers. Application and domain-specific processors/controllers like Digital Signal Processors (DSP) and Application Specific Integrated Circuits (ASICs) emerged.
- Fourth Generation: System on Chips (SoC), reconfigurable processors, and multicore processors, which bring high performance, tight integration, and miniaturization.
Classification Based on Complexity and Performance
- Small-scale:
- Simple applications where performance requirements are not time-critical.
- Built around low-performance and low-cost 8 or 16-bit .
- Medium-scale:
- Slightly complex in hardware and firmware requirement.
- Built around medium performance and low cost 16 or 32-bit .
- Large-scale:
- Highly complex hardware & firmware.
- Built around 32 or 64-bit RISC or PLDs or SoC or multi-core processors.
Classification Based on Deterministic Behaviour
- Applicable for ‘Real Time’ systems.
- Application/task execution behaviour can be either deterministic or non-deterministic.
- Based on the execution behaviour, real-time embedded systems are classified into Hard Real Time and Soft Real Time systems.
Classification Based on Triggering
- Embedded systems which are ‘Reactive’ in nature (like process control systems in industrial control applications) can be classified based on the trigger.
- Reactive systems can be either event-triggered or time-triggered.
Major Application Areas of Embedded Systems
- Household appliances: Television, DVD players, washing machine.
- Consumer electronics: cameras
- Home automation and security systems: Air conditioners, intruder detection alarms, fire alarms
- Automotive industry: automatic navigation systems
- Telecom: Cellular telephones
- Computer peripherals: Printers, scanners
- Healthcare: Different kinds of scanners, EEG, ECG machines
- Measurements & Instrumentation: Digital multimeters, digital CROs
- Banking & Retail: ATM
- Wearable devices: Health and Fitness Trackers
- Cloud Computing and Internet of Things (IoT)
Purpose of Embedded Systems
- Each embedded system is designed to serve one or a combination of the following tasks:
- Data Collection/Storage/Representation (Example: Digital camera)
- Data Communication (Example: Wireless network router)
- Data (Signal) Processing (Example: Digital hearing aid)
- Monitoring (Example: Patient monitoring system)
- Control (Example: Air Conditioner System)
- Application-Specific User Interface (Example: Mobile phone)
The Typical Embedded System
- Elements include:
- Microprocessor/controller
- Memory
- Embedded Firmware
- I/O ports (Sensors & Actuators)
- Communication interface
- Other supporting integrated circuits and subsystems
Core of the Embedded System
- Embedded systems are domain and application-specific and built around a central core.
- The core falls into one of the following categories:
- General Purpose and Domain Specific Processors
- Microprocessors
- Microcontrollers
- Digital Signal Processors
- Application-Specific Integrated Circuits (ASICs)
- Programmable Logic Devices (PLDs)
- Commercial off-the-shelf Components (COTS)
- General Purpose and Domain Specific Processors
General Purpose and Domain-Specific Processors
- Microprocessors
- General Purpose Processor (GPP) vs. Application-Specific Instruction Set Processor (ASIP)
- Microcontrollers
- Digital Signal Processors
- Program memory: Memory for storing the program required by DSP to process the data.
- Data memory: Working memory for storing temporary variables and data/signal to be processed
- Computational Engine: Performs the signal processing in accordance with the stored program memory
- I/O unit: Acts as an interface between the outside world and DSP. Responsible for capturing signals to be processed and delivering the processed signals
Microprocessor vs. Microcontroller
| Feature | Microprocessor | Microcontroller |
|---|---|---|
| Definition | Silicon chip with CPU, capable of performing arithmetic & logical operations according to a predefined set of instructions. | IC that contains a CPU, scratched RAM, special and general-purpose register arrays, on-chip ROM/FLASH memory, timer, and I/O ports. |
| Dependency | Dependent unit, requires other chips like timers, memory chips, interrupt controllers, etc. | Self-contained unit, does not require external interrupt controller, timer, UART, etc. |
| Orientation | Most of the time used in design and operation | Mostly application-oriented or domain-specific. |
| I/O Ports | Doesn’t contain built-in I/O ports; uses external programmable peripheral interface chips like 8255 | Contains multiple built-in I/O ports, operated as single 8/16/32-bit port or individual port pins |
| Target Market | Targeted for the high-end market where performance is important. | Targeted for the embedded market |
| Power Saving | Limited power-saving options compared to microcontrollers. | Includes lot of power-saving features. |
Elements of Washing Machine
An embedded system contains sensors, actuators, control unit and application-specific user interfaces like keyboards, display units, etc.
Components include:
- Integrated control panel with user interface
- Level sensor
- Water inlet pipe
- User interface
- LED display
- Keypad
- Inner tub
- Body case
- Temp Sensor
- Outer tub
- Water Outlet
The actuator part consists of a motorized agitator, tumble tub, water drawing pump, and inlet valve.
The sensor part consists of the water temperature sensor, level sensor, etc.
The control part contains a microprocessor/controller-based board with interfaces to the sensors and actuators.
The sensor data is fed back to the control unit, and the control unit generates the necessary actuator outputs.
The control unit also provides connectivity to user interfaces like the keypad for setting the washing time and selecting the type of material to be washed.
User feedback is reflected through the display unit and LEDs connected to the control board.
The integrated control panel consists of a microprocessor/controller-based board with I/O interfaces and a control algorithm running in it.
Input interface includes the keyboard with wash type selector (Wash, Spin, Rinse) and cloth type selector (Light, Medium, Heavy duty) and washing time setting, etc.
The output interface consists of LED/LCD displays, status indication LEDs, etc., connected to the I/O bus of the controller.
Other I/O interfaces which are invisible to the end user are different kinds of sensor interfaces, namely, water temperature sensor, water level sensor, etc., and actuator interface including motor control for agitator and tub movement control, inlet water flow control, etc.
Elements of Microwave Oven
- A microwave oven consists of:
- A high voltage transformer, which passes energy to the magnetron
- A cavity magnetron
- A Control circuit with a microcontroller
- A waveguide
- A cooking chamber
- A Transformer transfers electrical energy through a circuit by magnetic coupling without using motion between parts. These are used for supplying power to the magnetron.
- A Cavity magnetron is a microwave antenna placed in a vacuum tube and oscillated in an electromagnetic field to produce high GHz microwaves. Magnetrons are used in microwave ovens and radar systems.
- A control circuit with a microcontroller is integrated on a circuit board. The microcontroller controls the waveguide and the entire unit so the microwaves are emitted at a constant rate.
- A Waveguide is any linear structure that guides electromagnetic waves for the purpose of transmitting power or signals. Generally constructed of a hollow metal pipe. Placing a waveguide into a vacuum causes radio waves to scatter.
- A Cooking Chamber is a microwave-safe container which prevents microwaves from escaping. The door has a microwave-proof mesh with holes that are just small enough that microwaves can't pass through, but lightwaves can. The cooking chamber itself is a Faraday cage enclosure which prevents the microwaves from escaping into the environment. The oven door is usually a glass panel for easy viewing but has a layer of conductive mesh to maintain the shielding.
Watchdog Timer
- A watchdog timer (WDT) is a critical component in many microcontroller-based embedded systems.
- It's essentially a timer that monitors the operation of a microcontroller-based system.
- Its primary purpose is to reset the microcontroller if it becomes unresponsive or gets stuck in an infinite loop. This ensures the system's reliability and fault tolerance.
- This is a mechanism which helps microcontroller reboots (or restarts) when software hangs due to any external or internal faults or issues.
- Programmer will place "clrwdt" instruction at regular intervals in the source code.
- Due to some reasons, if this instruction does not get executed in some particular time period (known as timeout period), the microcontroller gets reset.
- The timeout period for the timer should be specified in the program called initialization of the watchdog timer.
- When the watchDog timer times out, it will cause "RESET". After this microcontroller executes instruction from location 0x0000.
- The timer requires a clock for its hardware operation. This clock is internal or external to the timer. The watchdog timer sends a reset signal to the processor/microcontroller when a timeout is reached. Based on clock frequency, the timeout interval will vary.
Digital Camera
Components:
- CCD
- Digital Camera Chip
- CCD preprocessor
- Pixel coprocessor
- D2A
- A2D
- Lens
- JPEG Codec
- Microcontroller
- Multiplier/Accum
- DMA controller
- Display ctrl
- Memory controller
- ISA bus interface
- UART
- LCD ctrl
Camera records pictures using a charge-coupled devices (CCD) array.
The array consists of a large number of horizontal rows and vertical columns of CCD cells for the picture.
In each row of cells, a number of CCD cells are unexposed to the picture but used for offset corrections in the each-row output from the picture cells.
A set of controllers- to control shutter, flash, auto focus and eye-ball image control.
LCD display for graphics and GUI Switches and buttons for inputs at camera.
When a button for opening the shutter is pressed, a flash lamp glows and a self-timer circuit switches off the lamp automatically
Inputs:
- Intensity and color values for each picture horizontal and vertical rows and columns of pixels in a picture frame.
- Intensity and color values for the unexposed (dark) area in each horizontal rows and columns of pixels.
- User control inputs
Outputs:
- Encoded file for a picture
- Permanent store of the picture at a file on flash memory stick
- Screen display of picture from the file after decoding
- File output to an interfaced computer and printer.
Functions of the system
A colour LCD dot matrix displays the picture before shooting- enables manual adjustment of view of the picture.
For shooting a shutter button pressed-a charge-coupled device (CCD) array placed at the focus generates a byte stream in output after operations by ADC on analog output of each CCD cell.
A file creates after encoding (compression) and pixel coprocessing.
The byte stream is preprocessed and then encoded in a standard format using a CODEC
The encoded picture file saved for permanent record, and a memory stick saves the file.
The file is used for display of recorded picture using a display processor and can be copied or transferred to a memory stick and to computer or printer connected through USB port
The LCD displays picture file after it is decoded (decompressed) using the CODEC. Text such as picture-title, shooting date and time and serial number are also displayed.
USB port is used for transferring and storing pictures on a computer.
Alternatively, Bluetooth or IR port can be used for interfacing the computer