IT 603(C) โ€ข Embedded Systems โ€ข Unit III

Input, Output and Peripheral Devices

Complete RGPV exam-oriented notes on timers, counters, watchdog timer, interrupt controller, PWM, keyboard controller, ADC, RTC and important serial, parallel and wireless communication protocols.

Start Unit 3 Notes

1. Introduction to I/O and Peripheral Devices 7 Marks

Input-output devices connect an embedded processor with the external world. Peripheral devices provide additional functions such as timing, conversion, communication, storage and control.
Sensors / Keys | v +-------------------+ | Input Interface | +---------+---------+ | v +-------------------+ | Processor / MCU | +----+---------+----+ | | v v +---------+ +-----------+ | Memory | |Peripherals| +---------+ +-----------+ | v Outputs / Actuators

Examples of Embedded Peripherals

  • Timers and counters
  • Interrupt controller
  • ADC and DAC
  • PWM controller
  • Serial communication interface
  • Real-time clock
  • Keyboard and display controller

2. Need for Peripheral Devices

  • To read physical input through sensors
  • To control motors, displays and actuators
  • To generate accurate delays
  • To count external events
  • To convert analog signals into digital form
  • To communicate with other devices
  • To maintain time and date
  • To protect the system from software failure

3. Timers 14 Marks

A timer is a hardware peripheral that counts internal clock pulses to measure time intervals or generate accurate delays.
System Clock | v +-----------+ Control Register | Prescaler |<------------------- +-----+-----+ | v +-----------+ | Timer | | Register | +-----+-----+ | Overflow / Compare Match | v Interrupt or Output Event

Working

  1. The system clock is supplied to the timer.
  2. A prescaler may reduce the clock frequency.
  3. The timer register increments or decrements.
  4. Overflow or compare match generates an event.
  5. The event can set a flag, generate an interrupt or change an output pin.

Applications

  • Generating delays
  • Periodic task scheduling
  • Measuring pulse width
  • Generating baud rate
  • Producing PWM signals
  • Time measurement
Timer Period = Number of Counts ร— Clock Period ร— Prescaler

4. Counters 7 Marks

A counter counts external events or pulses received through an input pin.

Timer vs Counter

FeatureTimerCounter
Input sourceInternal clockExternal pulses
Main purposeMeasure timeCount events
ExampleDelay generationCounting products on conveyor

Applications

  • Object counting
  • Frequency measurement
  • Speed measurement
  • Event monitoring
  • Digital tachometer

5. Watchdog Timer 14 Marks

A watchdog timer is a safety timer that automatically resets an embedded system if the software stops operating correctly.
Program Running Normally | v Reset / Refresh Watchdog | v +----------------------+ | Watchdog Countdown | +----------+-----------+ | Timeout Occurs? / \ No Yes | | Continue System Reset

Working

  1. The watchdog starts a countdown.
  2. Correct software periodically refreshes it.
  3. If the program hangs, refresh does not occur.
  4. The watchdog reaches timeout.
  5. It generates a reset or interrupt.

Advantages

  • Improves system reliability
  • Recovers from software lock-up
  • Useful in unattended systems
  • Provides fault tolerance
Used in automotive controllers, routers, industrial machines and medical devices.

6. Interrupt Controller 14 Marks

An interrupt is a signal that temporarily stops normal program execution and transfers processor control to an Interrupt Service Routine.
Interrupt Sources Timer ADC UART External Pin \ | | / +----+-----+------+ | v +-------------------+ | Interrupt | | Controller | +---------+---------+ | v Processor | v Interrupt Service Routine

Interrupt Sequence

  1. A peripheral generates an interrupt request.
  2. The interrupt controller checks enable and priority.
  3. The CPU completes the current instruction.
  4. Current processor state is saved.
  5. The ISR address is loaded.
  6. The ISR services the event.
  7. The saved state is restored.

Types

  • Hardware and software interrupts
  • Maskable and non-maskable interrupts
  • Vectored and non-vectored interrupts
  • Edge-triggered and level-triggered interrupts

Polling vs Interrupt

PollingInterrupt
CPU repeatedly checks device status.Device informs CPU only when service is needed.
Wastes CPU time.Better CPU utilization.
Simple implementation.Requires interrupt hardware and ISR.

7. Pulse Width Modulation 14 Marks

PWM is a technique in which the width of digital pulses is varied to control the average power delivered to a load.
High โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ Low โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€ <--- Period ---------> Duty Cycle = On Time / Period
Duty Cycle (%) = (ON Time รท Total Period) ร— 100

Working

  • The signal switches between high and low states.
  • Frequency may remain constant.
  • Changing ON time changes the duty cycle.
  • Higher duty cycle provides higher average output.

Applications

  • Motor speed control
  • LED brightness control
  • Power converters
  • Audio generation
  • Servo motor control
  • Heating control

8. Keyboard Controller 7 Marks

A keyboard controller detects pressed keys, performs scanning and provides the corresponding key code to the processor.

Rows R0 R1 R2 R3 | | | | +-------------+ C0-| o o o o | C1-| o o o o | Matrix Keyboard C2-| o o o o | C3-| o o o o | +-------------+ Keyboard Scanner

Matrix Keyboard Scanning

  1. Keys are arranged in rows and columns.
  2. The controller activates one row at a time.
  3. Column inputs are read.
  4. The row-column combination identifies the key.
  5. Debouncing removes false transitions.

Key Debouncing

Mechanical keys produce multiple rapid transitions when pressed. Hardware or software delay is used to recognize only one valid press.

9. Analog-to-Digital Converter 14 Marks

An ADC converts a continuous analog input voltage into a digital binary value that can be processed by an embedded processor.
Analog Sensor | v +----------------+ | Sample & Hold | +-------+--------+ | v +----------------+ | Quantizer | +-------+--------+ | v +----------------+ | Encoder | +-------+--------+ | v Digital Output

ADC Process

  1. Sampling: Measure the analog signal at intervals.
  2. Quantization: Map each sample to a discrete level.
  3. Encoding: Represent the level as binary data.
Number of Quantization Levels = 2โฟ, where n is ADC resolution
Approximate Step Size = Reference Voltage รท 2โฟ

Important Parameters

  • Resolution
  • Conversion time
  • Sampling rate
  • Reference voltage
  • Accuracy
  • Quantization error

Types of ADC

  • Flash ADC
  • Successive Approximation ADC
  • Dual-slope ADC
  • Sigma-delta ADC
ADC is used with temperature, pressure, light and sound sensors.

10. Real-Time Clock 7 Marks

A real-time clock is a low-power peripheral that maintains calendar time and date even when the main system is turned off.

Main Components

  • Low-frequency crystal oscillator
  • Time and date registers
  • Backup battery
  • Alarm and interrupt circuit
  • Serial interface

Applications

  • Digital clocks
  • Data loggers
  • Attendance systems
  • Alarm systems
  • Timestamp generation

11. Communication Protocol Terminology 7 Marks

  • Protocol: Rules for exchanging data.
  • Node: Device connected to a network.
  • Master: Device that initiates communication.
  • Slave: Device that responds to a master.
  • Host: Main controlling system.
  • Bus: Shared communication path.
  • Bandwidth: Data-carrying capacity.
  • Baud rate: Number of signal symbols per second.
  • Bit rate: Number of data bits transferred per second.
  • Simplex: One-way communication.
  • Half duplex: Both directions, one at a time.
  • Full duplex: Both directions simultaneously.
  • Synchronous: Communication uses a shared clock.
  • Asynchronous: No continuous shared clock.

12. Serial Communication Protocols

Serial communication transfers data one bit at a time through one or a small number of signal lines.

Advantages

  • Requires fewer wires
  • Lower cost
  • Suitable for longer distances
  • Simple connectors
  • Reduced electromagnetic interference

Protocols in the Syllabus

  • I2C
  • CAN
  • FireWire
  • USB

13. I2C Protocol 14 Marks

I2C, or Inter-Integrated Circuit, is a synchronous serial bus that uses two shared signal lines for communication between integrated circuits.
+---------+ SDA ----------| Master |----------+ SCL ----------| |----------+ +---------+ | | +----------+ +----------+ | | Slave 1 | | Slave 2 |-+ +----------+ +----------+ SDA = Serial Data SCL = Serial Clock

Main Features

  • Two-wire interface
  • Master-slave communication
  • Address-based device selection
  • Multiple devices on one bus
  • Acknowledgement mechanism
  • Synchronous transfer

Basic Transfer

  1. Master generates START condition.
  2. Master sends slave address and read/write bit.
  3. Addressed slave sends acknowledgement.
  4. Data bytes are transferred.
  5. Receiver acknowledges each byte.
  6. Master generates STOP condition.

Advantages and Limitations

  • Uses only two wires and supports many devices.
  • Suitable for sensors, EEPROMs and RTCs.
  • Speed and distance are lower than some high-speed buses.

14. CAN Protocol 14 Marks

CAN, or Controller Area Network, is a robust message-based serial communication protocol designed for reliable communication between controllers.
+--------+ CAN_H / CAN_L +--------+ | Node A |==========================| Node B | +--------+ || +--------+ || +--------+ | Node C | +--------+

Main Features

  • Multi-master bus
  • Message-based communication
  • Priority-based arbitration
  • Strong error detection
  • Automatic retransmission
  • Differential signaling
  • Good noise immunity

Arbitration

When multiple nodes transmit together, the message with the higher priority identifier continues while other nodes stop without corrupting the bus.

Applications

  • Automobiles
  • Industrial automation
  • Medical equipment
  • Robotics
  • Elevator control

15. FireWire โ€“ IEEE 1394 7 Marks

FireWire is a high-speed serial bus developed for real-time multimedia and peripheral communication.

Features

  • High-speed serial transfer
  • Peer-to-peer communication
  • Supports isochronous data transfer
  • Hot plugging
  • Suitable for continuous audio and video

Applications

  • Digital video cameras
  • Professional audio equipment
  • External storage devices

16. USB Protocol 14 Marks

USB, or Universal Serial Bus, is a host-controlled serial communication standard used to connect peripheral devices.
+-------------+ | USB Host | +------+------+ | USB Hub +--------+--------+ | | | Device 1 Device 2 Device 3

Main Features

  • Plug and play
  • Hot plugging
  • Device addressing
  • Power and data through cable
  • Multiple transfer types
  • Hierarchical star topology

Transfer Types

  • Control: Device configuration
  • Bulk: Large reliable data transfer
  • Interrupt: Small periodic transfers
  • Isochronous: Time-sensitive audio and video

Applications

  • Keyboard and mouse
  • Printer
  • Camera
  • Storage device
  • Embedded development boards

17. Parallel Communication Protocols

Parallel communication transfers multiple bits simultaneously using multiple data lines.

Advantages

  • High transfer rate over short distances
  • Simple simultaneous bit transfer

Limitations

  • Requires more wires and connector pins
  • Higher cost
  • Timing skew between lines
  • Not ideal for long distances

18. PCI Bus 14 Marks

PCI, or Peripheral Component Interconnect, is a parallel local bus used to connect high-speed peripheral devices to a processor system.
+-----------+ | Processor | +-----+-----+ | +-----v-----+ | Host / PCI| | Bridge | +-----+-----+ | ====== PCI Bus ================= | | | v v v Device 1 Device 2 Device 3

Main Features

  • Shared parallel bus
  • Supports bus mastering
  • Automatic device configuration
  • Address, data and control signals
  • Suitable for high-speed peripherals
  • Arbitration controls bus ownership

Applications

  • Network controllers
  • Audio cards
  • Storage controllers
  • Data-acquisition systems

19. Wireless Communication Protocols

Wireless protocols transfer information through electromagnetic or infrared signals without physical data cables.

Benefits

  • Mobility
  • Easy installation
  • Reduced cabling
  • Communication with portable devices

Limitations

  • Interference
  • Security risks
  • Limited range or bandwidth
  • Power consumption

20. IrDA 7 Marks

IrDA is a short-range wireless communication standard that uses infrared light.

Features

  • Line-of-sight communication
  • Short range
  • Low interference through walls
  • Low-cost implementation
  • Point-to-point communication

Applications

  • Remote controls
  • Short-range device communication
  • Medical instruments
  • Legacy mobile and computer peripherals

21. Bluetooth 14 Marks

Bluetooth is a short-range wireless technology used for low-power data and audio communication in the 2.4 GHz band.
+-------------+ | Central / | | Master | +------+------+ | +---------+---------+ | | | Device A Device B Device C

Main Features

  • Short-range radio communication
  • Low power operation
  • Device discovery and pairing
  • Frequency hopping
  • Supports data and audio services
  • Bluetooth Low Energy supports IoT sensors

Applications

  • Wireless headphones
  • Fitness trackers
  • Smart-home devices
  • Medical sensors
  • Wireless keyboards and mice

22. IEEE 802.11 Wireless LAN 14 Marks

IEEE 802.11 is a family of wireless local-area network standards commonly known as Wi-Fi.
Internet | v +----------------+ | Access Point | +---+--------+---+ | | v v Device 1 Device 2 | v Embedded IoT Node

Main Components

  • Wireless station
  • Access point
  • Basic service set
  • Wireless medium

Features

  • Wireless LAN connectivity
  • Higher range and bandwidth than many short-range protocols
  • Infrastructure and direct communication modes
  • Security and authentication mechanisms
  • Useful for connected embedded systems

Applications

  • Smart appliances
  • Security cameras
  • Industrial monitoring
  • Home automation
  • IoT gateways

23. Important Protocol Comparisons 14 Marks

I2C vs CAN

FeatureI2CCAN
Main useOn-board chip communicationReliable controller network
LinesSDA and SCLCAN_H and CAN_L
ArchitectureMaster-slaveMulti-master message bus
Error handlingBasic acknowledgementStrong error detection and recovery
EnvironmentShort on-board distanceNoisy automotive and industrial systems

Bluetooth vs Wi-Fi

FeatureBluetoothWi-Fi
RangeUsually shorterUsually longer
PowerLower, especially BLEGenerally higher
BandwidthLowerHigher
Main usePersonal devices and sensorsLAN and Internet access

Serial vs Parallel Communication

SerialParallel
Transfers one or few bits at a time.Transfers multiple bits simultaneously.
Uses fewer wires.Uses more wires.
Suitable for longer distances.Mostly suitable for short distances.
Examples: I2C, CAN, USB.Example: traditional PCI bus.

Unit 3 Quick Revision

  • A timer counts internal clock pulses.
  • A counter counts external events.
  • A watchdog timer resets a failed system.
  • An interrupt transfers control to an ISR.
  • PWM controls average power using duty cycle.
  • An ADC converts analog voltage into digital data.
  • An RTC maintains time and date.
  • I2C uses SDA and SCL lines.
  • CAN is reliable and suitable for automotive networks.
  • USB is host controlled and supports multiple transfer types.
  • PCI is a parallel peripheral bus.
  • IrDA uses infrared line-of-sight communication.
  • Bluetooth is suited to short-range low-power links.
  • IEEE 802.11 provides Wi-Fi networking.

Important RGPV Exam Questions

Long Answer Questions

  1. Explain timers and counters with suitable diagrams and applications.
  2. Explain the working of a watchdog timer.
  3. What is an interrupt controller? Explain the interrupt sequence.
  4. Explain PWM and derive the duty-cycle expression.
  5. Explain matrix-keyboard interfacing and key debouncing.
  6. Explain ADC operation, parameters and types.
  7. Explain a real-time clock and its applications.
  8. Explain I2C protocol with a neat diagram and transfer sequence.
  9. Explain CAN protocol, arbitration and error-handling features.
  10. Write notes on FireWire and USB.
  11. Explain PCI bus architecture.
  12. Explain Bluetooth architecture, features and applications.
  13. Explain IEEE 802.11 wireless LAN.
  14. Compare I2C and CAN.
  15. Compare Bluetooth and Wi-Fi.

Short Answer Questions

  1. Differentiate timer and counter.
  2. What is watchdog timeout?
  3. Define ISR.
  4. What is duty cycle?
  5. Define ADC resolution.
  6. What is key debouncing?
  7. What are SDA and SCL?
  8. What is CAN arbitration?
  9. List USB transfer types.
  10. What is IrDA?
Exam Tip: Draw labeled diagrams for timer, watchdog, interrupt controller, PWM waveform, ADC, I2C, CAN, USB, PCI and wireless architecture.

Download Study Resources

Unit 3 PDF

Printable detailed notes will be available soon.

Coming Soon

Protocol Diagrams

Exam-ready communication diagrams coming soon.

Coming Soon

PYQ Analysis

Repeated Unit 3 questions coming soon.

Coming Soon

Frequently Asked Questions

A timer counts internal clock pulses to measure time, while a counter counts pulses or events coming from an external source.
It automatically resets or recovers the system when software hangs and fails to refresh the watchdog before timeout.
Duty cycle is the percentage of one period during which the PWM signal remains ON or high.
I2C normally uses two shared lines: SDA for serial data and SCL for serial clock.
CAN offers differential signaling, priority arbitration, strong error detection and good noise immunity.
Bluetooth generally targets short-range and low-power communication, while Wi-Fi provides higher bandwidth and network or Internet connectivity.