ESD UNIT 2
ESD UNIT 2
UNIT – 2
1) Explain in detail about various Input and output types with
example ?
Ans: Embedded systems interact with the external world through various input
and output (I/O) devices. Here are some common types of I/O devices used in
embedded systems:
# Input Devices
1. Sensors: Sensors detect physical parameters such as temperature, pressure,
light, and sound. Examples include thermistors, photodiodes, and microphones.
2. Switches: Switches are used to detect user input, such as button presses or
toggle switches.
# Output Devices
1. LEDs: LEDs are used to display status information, such as power on/off or
error conditions.
# Examples
1. Smart Thermostat: A smart thermostat uses sensors to detect temperature and
humidity levels, and outputs data to a display or a mobile app. It may also use
actuators to control heating or cooling systems.
2. Fitness Tracker: A fitness tracker uses sensors to detect movement and heart rate,
and outputs data to a display or a mobile app. It may also use actuators to provide
alerts or notifications.
3. Home Security System: A home security system uses sensors to detect motion or
door openings, and outputs data to a display or a mobile app. It may also use actuators
to sound alarms or notify authorities.
2. Serial or Parallel: Serial protocols transmit data one bit at a time, while
parallel protocols transmit multiple bits simultaneously.
3. Master-Slave Architecture: Some protocols, like SPI and I2C, use a master-
slave architecture, where one device controls the communication.
4. Data Transfer Rate: The data transfer rate varies between protocols, with
some, like USB, supporting high-speed transfers.
3. Feedback Control: The system uses feedback from sensors to adjust the
control decisions.
Security and Authentication
1. Device Authentication: Networked embedded systems authenticate devices to
ensure only authorized devices can connect to the network.
3. Access Control: The system controls access to data and devices based on user
roles and permissions.
3. Alert Generation: The system generates alerts based on predefined conditions, such
as threshold values or anomalies.
# 1. Interrupt Detection
- Polling: The system continuously checks for interrupts by polling the interrupt
register.
# 2. Interrupt Prioritization
- Fixed Priority: Interrupts are assigned a fixed priority level, and the highest-
priority interrupt is serviced first.
- Dynamic Priority: Interrupts are assigned a dynamic priority level, which can
change based on the system's current state.
# 3. Interrupt Handling
- Interrupt Service Routine (ISR): A specialized routine that handles the
interrupt and performs the necessary actions.
- Context Switching: The system switches context to the ISR, saving the current
state and restoring it when the ISR completes.
# 4. Interrupt Masking
- Interrupt Masking: The system can mask interrupts to prevent them from being
serviced, allowing critical code to execute without interruption.
- Interrupt Unmasking: The system can unmask interrupts to allow them to be
serviced again.
# 5. Interrupt Nesting
- Nested Interrupts: The system can handle nested interrupts, where an interrupt
occurs while another interrupt is being serviced.
- Interrupt Stack: The system uses an interrupt stack to store the context of each
interrupt, allowing for efficient handling of nested interrupts.
# 6. Interrupt Latency
- Interrupt Latency: The time it takes for the system to respond to an interrupt
and start executing the ISR.
# 8. Interrupt Controllers
- Programmable Interrupt Controllers (PICs): PICs manage interrupts and
prioritize them based on their priority level.
4. Input/Output: Timing and counting devices often have input and output
signals that allow them to interact with other components or systems.
# Applications of Timing and Counting Devices in
Embedded Systems
1. Scheduling: Timing devices can be used to implement scheduling
functions, such as task scheduling or interrupt handling.
2. Synchronization: Timing devices can be used to synchronize events or
tasks in an embedded system.
3. Timeout Functions: Timing devices can be used to implement timeout
functions, such as watchdog timers or timeout interrupts.
4. Event Counting: Counting devices can be used to count events, such as
button presses or sensor readings.
3. Real-Time Clock (RTC) Modules: RTC modules are devices that provide accurate
time and date information.
4. Watchdog Timer Modules: Watchdog timer modules are devices that monitor a
system's activity and reset it if it becomes unresponsive or hangs.
4. Reliability and Fault Tolerance: The reliability and fault tolerance of a timing
or counting device must be carefully considered to ensure that it can operate
correctly in the presence of faults or errors.
2. HTTP (Hypertext Transfer Protocol): A protocol used for transferring data over the
web, including requests and responses between clients and servers.
3. FTP (File Transfer Protocol): A protocol used for transferring files between devices
over the internet.
4. SSH (Secure Shell): A protocol used for secure remote access to devices and
servers.
5. DNS (Domain Name System): A protocol used for translating domain names into
IP addresses.
7. SNMP (Simple Network Management Protocol): A protocol used for managing and
monitoring network devices.
8. SMTP (Simple Mail Transfer Protocol): A protocol used for sending and receiving
email.
Network Protocol Layers
1. Physical Layer: Defines the physical means of transmitting data between
devices, such as Wi-Fi or Ethernet.
2. Data Link Layer: Provides error-free transfer of data frames between devices,
such as Ethernet or PPP.
3. Network Layer: Routes data between devices, such as IP or ICMP.
4. Transport Layer: Provides reliable data transfer between devices, such as TCP or
UDP.
6. Presentation Layer: Converts data into a format that can be understood by devices,
such as SSL/TLS or MIME.
3. Reliable: Protocols that ensure data is delivered correctly and in the correct order,
such as TCP.
4. Unreliable: Protocols that do not guarantee data delivery or order, such as UDP.
3. File Transfer: FTP and SFTP are used for file transfer.
4. Remote Access: SSH and VPN are used for remote access.
5. Network Management: SNMP and ICMP are used for network management.
3. Firewalls: Firewalls are used to block unauthorized access to devices and networks.
4. Intrusion Detection and Prevention: IDPS systems are used to detect and prevent
network attacks.