Professional Documents
Culture Documents
&MICROCONTROLLERS
On board Communication
UNIT-IV
B.Tech, ETM,
II Year, II Semester
N.Ramakrishna
Dept. of Electronics and Telematics Engineering
GNITS, Hyderabad
I2C bus is a shared bus system to which many number of I2C devices can be
connected.
Devices connected to the I2C bus can act as either ‘Master’ device or ‘Slave’ device.
‘Slave’ devices wait for the commands from the master and respond upon receiving
the commands.‘ Master’ and ‘Slave’ devices can act as either transmitter or receiver.
SDA
2.2K
Port Pins SCL
Slave 1
SCL I2C Device
Master SDA (Eg: Serial
(Microprocessor/ EEPROM)
Controller)
SCL Slave 2
SDA I2C Device
I2C Bus
• Master:
– Initiates a transfer by generating
start and stop conditions
– Generates the clock
– Transmits the slave address
– Determines data transfer direction
• Slave:
– Responds only when addressed
– Timing is controlled by the clock line
16 March 2020 ES- N.Ramakrishna
First Byte in Data Transfer on the I2C Bus
MSB LSB
R / Wr
R/Wr
0 – Write Operation
1 – Read Operation
• Masters can be
– Transmitter only
– Transmitter and receiver
• Slaves can be
– Receiver only
– Receiver and transmitter
A A A
Master Out Slave In (MOSI): Signal line carrying the data from master to slave
device. It is also known as Slave Input/Slave Data In (SI/SDI).
Master In Slave Out (MISO): Signal line carrying the data from slave to master
device. It is also known as Slave Output (SO/SDO).
SPI Bus
MISO
SCL
MOSI MOSI Slave 1
SCL SPI Device
Master
MISO (Eg: Serial
(Microprocessor/
SS\ EEPROM)
Controller)
SS1\
SS2\
MOSI
Slave 2
SCL
SPI Device
MISO
(Eg: LCD)
SS\
SPI Bus
16 March 2020 ES- N.Ramakrishna
On-board Communication Interface– SPI Bus
The master device is responsible for generating the clock signal. Master
device selects the required slave device by asserting the corresponding slave
device’s slave select signal ‘LOW’.
The data out line (MISO) of all the slave devices when not selected floats at
high impedance state .
The serial data transmission through SPI Bus is fully configurable. SPI devices
contain certain set of registers for holding these configurations.
The status register holds the status of various conditions for transmission and
reception.
SPI works on the principle of ‘Shift Register’. The master and slave devices contain a
special shift register for the data to transmit or receive.
At the same time the shifted out data bit from the slave device’s shift register
enters the shift register of the master device through MISO pin.
TXD TXD
UART UART
RXD RXD
The serial communication settings (Baudrate, No. of bits per byte, parity, No.
of start bits and stop bit and flow control) for both transmitter and receiver
should be set as identical.
While sending a byte of data, a start bit is added first and a stop bit is added
at the end of the bit stream. The least significant bit of the data byte follows
the start bit.
The ‘Start’ bit informs the receiver that a data byte is about to arrive. The receiver
device starts polling its ‘receive line’ as per the baudrate settings.
If parity is enabled for communication, the UART of the transmitting device adds
a parity bit .
The UART of the receiving device calculates the parity of the bits received and
compares it with the received parity bit for error checking.
The UART of the receiving device discards the ‘Start’, ‘Stop’ and ‘Parity’ bit from
the received bit stream and converts the received serial bit data to a word
USB Logo
April
16 March
4, 2016
2020 ES- N.Ramakrishna
External Communication Interface –
Universal Serial Bus (USB)
ES- N.Ramakrishna 31
16 March 2020
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface – Universal Serial
Bus (USB)
Universal Serial Bus (USB) is a wired high speed
serial bus for data communication.
Peripheral
The USB communication system follows a star Device 2
topology with a USB host at the center and one or
more USB peripheral devices/USB hosts connected Peripheral USB Host Peripheral
to it. Device 1 (Hub) Device 3
The PID and VID are embedded into the USB chip by the USB device manufacturer.
PID and VID are essential for loading the drivers corresponding to a USB device for
communication.
April
16 March
4, 2016
2020 ES- N.Ramakrishna
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 ES- N.Ramakrishna
External Communication Interface –
Universal Serial Bus (USB)
USB
• The serial data is sent along the USB in differential
or push-pull mode, with opposite polarities
on the two signal lines.
• This improves the signal-to-noise ratio by doubling the effective signal amplitude
and also allowing the cancellation of any common-mode noise induced into the
cable.
• The data is sent in non-return-to-zero (NRTZ) format.
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan Unit V Part 2 46
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 MPMC-
ES-
Moorthy
N.Ramakrishna
Muthukrishnan
External Communication Interface –
Universal Serial Bus (USB)
April
16 March
4, 2016
2020 ES- N.Ramakrishna