M2.1
M2.1
EMBEDDED SYSTEM
INTERFACING AND
PERIPHERALS
Topics:
2
Communication devices
Serial Communication Standards and Devices
UART, HDLC and SPI.
Serial Bus Protocols
I2C Bus, CAN Bus and USB Bus (self-study).
Parallel communication standards
ISA, PCI and PCI-X Bus.
Topics:
3
I/O Devices
Interrupts – Interrupt sources, recognizing an
interrupt,
ISR – Device drivers for handling ISR, Shared
data problem, Interrupt latency.
References:
5
◻ Electrical Power.
◻ Control Signals.
◻ Memory Address.
◻ Data.
Bus Communication for
11
networking
◻ Bus communication simplifies the number of
connections and provides a common way (protocol)
of connecting different or same type of I/O devices
IO Bus
12
19
Ref:- Raj Kamal, Embedded Systems Architecture, Programming and
Parallel communication standards
20
22
Serial & Parallel Transfer
23
Synchronous & Asynchronous
Transmission
Fig: Synchronous
Transmission
24
Fig: Asynchronous
Synchronous Transmission
• Efficiency is
comparatively very
high.
• Speed of data
transmission is very
high.
• No need to transmit
start and stop bit.
• In case of transmitting a
lot of data, this method
• Primary storage device is required.
is suitable.
• Comparatively expensive.
• Synchronization between the source and target is
25
required.
Asynchronous Transmission
◻ No synchronization is
required between the
transmitter and receiver
devices. Sender can
directly transmit data, and
the receiver can receive
that data.
◻ The sender does not require
any primary storage device.
◻ Cost is very low to
implement this method.
◻ It is convenient while
• Data transmission speed is very transmitting a little amount
low.
of data.
• Efficiency is comparatively less.
26
Isochronous Transmission
27
◻
Bit rate & Baud rate
31
For example:
◻ A figure of 2400 bits per second means 2400 zeros
36
Data frame of UART
37
Data frame of UART
38
Configured to transmit and receive
39
◻ Microcontroller Communication:
Communication between a microcontroller (like
Arduino or STM32) and a sensor, display, or other
peripheral devices.
◻ Debugging:
Using UART to output debugging information from a
microcontroller to a PC terminal, such as Arduino
Serial Monitor.
◻ Embedded Systems:
UART is commonly used in embedded systems for
interfacing components such as GPS modules,
Bluetooth modules, or GSM modems.
Usage of UART
46
◻ PC Peripherals:
Connecting legacy peripherals like mice, modems, or
printers to a computer.
◻ Data Communication:
Communication between two microcontrollers for
exchanging data like sensor readings or control
commands.
◻ IoT Applications:
Connecting an ESP8266 or ESP32 Wi-Fi module to a
microcontroller using UART for wireless
communication in IoT projects.
UART Example
47
WAN Protocol:
HDLC is extensively used in Wide Area Network (WAN)
communication for encapsulating data over serial links.
Routers in a WAN using HDLC to transmit data across leased
lines.
Telecommunications:
Used in telecom networks for communication between
exchanges and equipment.
HDLC is employed in ISDN (Integrated Services Digital
Network) and X.25 protocols.
Embedded Systems:
Facilitates communication between embedded devices in
industrial and automotive applications.
Used for reliable data transfer between controllers in a factory
automation system.
HDLC Example:
55
One station
controls the
other stations
68
HDLC – Control field
format
69
Three different classes of frames
70
used in HDLC
◻ Unnumbered frames, used for exchanging session
management and control information between
communicating devices.
◻ Information frames, which carry actual information. If
the first bit in control field is 0 it is identified as
I-frame.
◻ Supervisory frames, which are used for error and flow
control purposes and hence contain send and receive
sequence numbers. If first two bits of control field are 1
and 0 it is identified as S-frame.
HDLC – Control field format
71
ignored.
◻ Provide dialogue between the primary station and
secondary station.
Frame check Sequence field
◻ 16-bit or 32-bit cyclic redundancy check bits.
S-Frame
◻ Four types of S-frames are possible corresponding to
four values of ‘S’
◻ SS=00 corresponds to Receive Ready (RR) frames.
◻ SS=01 Reject (REJ) is used to request the
retransmission of frames.
◻ SS=10 corresponds to Receive not Ready (NRN)
frame and is used for flow control.
◻ SS=11 Selective Reject (SREJ) is used by a station
to request retransmission of specific frames.
HDLC – Control field format
73
Shift register
• Size – multiple of 8
• Data in & out
• LS/MS bit configuration register
SPI - Data Transmission
77