How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdfTamanna
Growth of Public Expendituuure_55423.pptNavyaDeora
AUDITABILITY & COMPLIANCE OF AI SYSTEMS IN HEALTHCAREGAHI Youssef
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...apidays
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...apidays
What does good look like - CRAP Brighton 8 July 2025Jan Kierzyk
Ad
Communication_Protocols[2][1].pptx on protocoals
1. Communication protocols and
interfacing with external device of
TIVA
ANIRUDH SHARMA 22010104007
VIVEK THAKUR 22010104070
NITIN RAJ 22010104049
ISHAN 22010104031
SOURABH DHIMAN 22010104061
Course Advisor : Er. Sanjeev Kumar
2. What is serial communication
Serial communication is a method of transmitting data one bit at a
time over a communication channel. It is widely used in electronics and
computer systems for data transfer between devices, such as
microcontrollers, sensors, computers, and peripherals.
3. Introduction
Microcontrollers or System on Chips (SoC) are important
components of modern-day electronic systems.
But microcontrollers alone can't make systems. For any
system to work, it needs
memory, displays, real time clock,
interfaces to the external world etc.
The modern-day microcontrollers are
enabled with several communication
protocols to achieve the
requirement
of communication.
These communication protocols can
Be wireline or wireless.
4. • Communication between the microcontroller and other peripheral devices can be implemented in two ways:
parallel and serial. In parallel communication, 8-bit or 16-bit bus is connected with external device.
5. Synchronous and Asynchronous protocols
SYNCHRONOUS ASYNCHRONOUS
In synchronous communication, data is
transmission and receiving is a continuous
stream at a constant rate. Synchronous
communication requires the clock of
transmitting device and receiving device
synchronized.
In the case of asynchronous
communication, the transmission
of data requires no clock signal
and data transfer occurs
intermittently rather than steady
stream.
Examples of synchronous communication
are:
I2C, SPI etc.
Examples of asynchronous
communication are Universal
Asynchronous Receiver Transmitter
(UART), CAN etc.
6. Half and Full duplex communication
• In data transmission, a duplex transmission is one in which data can be
transmitted as well as received. In a simplex transmission, device is configured a
transmitter or receiver.
• One example is a PC communicating with printers, in which the computer only
sends data.
• Duplex transmissions are categorized as half or full duplex.
HALF DUPLEX FULL DUPLEX
.
7. UART(Universal
Asynchronous
Receive Transmitter)
• Universal Asynchronous Receiver-Transmitter (UART) is
commonly known as Serial Communication Interface (SCI)
when it was incorporated in microcontrollers.
• It is an asynchronous protocol and used mainly in
interfacing microcontrollers with personal computers. This
protocol is also known as RS-232 protocol. UART can be
used in various applications such as GPS units, modems etc.
8. Data Frame in
UART
• It is difficult to sense the continuous stream of 1s and 0s. Generally,
protocols, define how data is packed, how many bits make a
character, how data begins and ends.
• Asynchronous serial data communication is used for character
transmissions. Between start and stop bits, characters are packed.
The start bit is always one bit but the stop bit can be one or two
bits.
• The start bit is always logic 0(low) and the stop bit is logic 1(high).
9. Serial I/O
Standards
• UART follows RS-232 standards. RS represents
„Recommended Standard‟ , this standard is
adopted before the advent of CMOS and TTL logic.
• To connect RS-232 to other devices which are
compliance with TTL, we need voltage converter
circuits. The most commonly used voltage
converter devices are MAX232 or MAX233
11. Programming UART on
Tiva Platform
UART Control register (UARTCTL)
UART Line Control Register
(UARTLCTH)
UART Data Register (UARTDR)
RCGCUART (UART Run Mode Clock
Gating Control).
I/O pins for UART: Along with special
function registers
Baud Rate Generators
12. Sending "HELLO" via UART to HyperTerminal
• Enable Clocks for UART0 and GPIO:
SYSCTL->RCGCUART |= 1; (Enable clock for UART0)
SYSCTL->RCGCGPIO |= 1; (Enable clock for GPIO Port A)
Initialize UART0 Settings:
UART0->IBRD = 104; (Set baud rate: 9600)
UART0->CC = 0; (Use system clock)
UART0->CTL = 0x301; (Enable UART0 TX/RX)
Configure GPIO for UART0 (PA0 and PA1):
GPIOA->DEN = 0x03; (Enable PA0, PA1 as digital pins)
GPIOA->PCTL = 0x11; (Configure PA0 and PA1 for UART0)
13. Inter IC (I2C)
Communication
Protocol
• I2C is also known as an inter-integrated circuit.
• It is a synchronous half-duplex serial communication
protocol. I²C (Inter-Integrated Circuit) is a
synchronous, multi-master, multi-slave communication
protocol that uses two bidirectional lines: Serial Data
Line (SDA) and Serial Clock Line (SCL)
• It allows devices to communicate by sending data in a
master-slave configuration, where the master controls
the clock and initiates communication.
14. • The four possible modes of operation are:
1. Master Transmit Mode
•The TIVA MCU acts as the master and sends
data to a slave device.
•The master generates the clock signal (SCL) and
initiates communication by sending the slave
address followed by the data.
1. Master Transmit Mode
• The TIVA MCU acts as the master and
sends data to a slave device.
• The master generates the clock signal
(SCL) and initiates communication
by sending the slave address followed
by the data.
3. Slave Transmit Mode
• The TIVA MCU acts as a slave and
sends data when requested by a
master.
• The master initiates the read
request, and the slave responds
with data.
4. Slave Receive Mode
• The TIVA MCU acts as a slave and
receives data from a master.
• The master sends data, and the slave
acknowledges and stores it.
2. Master Receive Mode
• The TIVA MCU acts as the master and
receives data from a slave.
• The master sends the slave address
with the read bit set, and the slave
responds by sending the requested
data.
15. START and STOP
bits format:
• START and STOP bits are generated by
master.
• START bit is generated by high to low
transition in SDA line when SCL is high.
• STOP bit is generated by low to high
transition in SDA line when SCL is low.
16. Arbitration
• In an I2C network, there can be many master devices. When two masters start
using bus at a same time, there will be conflict between the devices.
• The solution to this problem is through arbitration mechanism. Wired AND
logic is used for arbitration.
Master A wants to send “0001 0100”
Master B wants to send “0010 0100”
who wins the arbitration ?
17. Solution:
• The first two bits of both A
and B is “00”.
• And the third bit of device A
is logic ‘0’ and B is logic ‘1’.
• In I2C, logic ‘0’is dominant
bit, and device
• A will win the arbitration
and get the access to the
bus and transmits data.
A >>> 0001 0100
B >>> 0010 0100
18. How I²C Communicates with External Devices
Step-by-Step Communication Process
1.Master (TIVA) sends a START condition (pulls SDA low while SCL is high).
2.Master sends the slave address (7-bit address + Read/Write bit).
3.Slave acknowledges (ACK) if the address matches.
4.Data is transferred between master and slave (either read or write).
5.Master sends a STOP condition (releases SDA while SCL is high).
19. Serial Peripheral Interface (SPI)
• Serial peripheral interface (SPI) is a serial communication interface originally
designed by Motorola in late eighties. SPI and I2C came into existence almost at
the same time.
MASTER SLAVE
20. • SPI is a synchronous serial communication protocol like I2C, where master generates clock and data transfer
between master and slave happens with respect to clock.
• Both master and slave devices will have shift registers connected to input and output .
• SPI Modes
21. SPI in Tiva
Microcontroller ( SSI
Module)
• Synchronous Serial Interface Run Mode Clock Gating Control
CRCG (SSI) Register : ( 32 bit)
>>>> SSICR0 (SSI control register 0) is used to configure the SSI
>>>> the SSI in Tiva microcontroller allows transfer of data
between 4 bits to
16 bit.
>>>> The value in a MS bit in SSI control register 1 (SSICR1)
decide the microcontroller as master or slave.
SSI DATA Register :
The SSIDR is used for both as transmitter and receiver buffer. In
SPI handling 8-bit data, will be placed into the lower 8-bits of the
register and the rest of the register are unused. In the receive
mode, the lower 8-bit holds the received data.
22. SSICR0 (SSI control register 0) is used
to configure the SSI
23. • SPI module can act like slave or a master. The value in a MS bit in SSI control register 1 (SSICR1) decide the
microcontroller as master or slave. SSE bit in the SSICR1 register is used to enable/ disable the SPI.
• Bit Rate
The SSICR0 (SSI Control register 0) allows the Bit Rate selection among other things. The
output of clock pre-scaler circuitry is divided by 1 + SCR and then used as the SSI baud
rate clock. The value of SCR can be from 0 to 255. The below formula is used to calculate
the bit rate.
• Bit Rate (BR): BR = SysClk
(CPSDVSR × (1 + SCR))
24. Status Flag Register :
• SSISR is used to monitor transmitter/receiver buffer is empty.
25. SPI data transmission
Enable SPI clock in RCGCSSI and disable SSI in SSICR1.
Set bit rate using SSICPSR and configure SPI mode in SSICR0.
Set master mode in SSICR1 and enable SSI.
Assert slave select, load data into SSIDR, wait for completion, then
de-assert slave select.
26. * command for Tiva Microcontroller to use
SSI1 (SPI) to transmit A to Z characters
void init_SSI1(void);
void SSI1Write(unsigned char data);
int main(void)
{ unsigned char i;
init_SSI1(); for(;;)
{ for (i = 'A'; i <= 'Z'; i++)
{ SSI1Write(i); /* write a character */
}
27. SPI Applications:
SPI is used to talk to a variety of peripherals, such as
• Sensors: temperature, pressure, ADC, touchscreens, video game
controllers
• Control devices: audio codecs, digital potentiometers, DAC
• Camera lenses: Canon EF lens mount
• Memory: flash and EEPROM
• Real-time clocks
• LCD, sometimes even for managing image data
28. I2C Applications
Sensor Interfacing: Connecting temperature, pressure, humidity,
accelerometer, and gyroscope sensors
EEPROM Communication: Storing and retrieving data from EEPROM
chips.
Real-Time Clocks (RTC): Interfacing with RTC modules like DS1307 and
DS3231
Engine Control Units (ECU): Communication between sensors and
controllers.
Dashboard Display Units: Displaying information from various vehicle
sensors.
Airbag Systems & ABS: Interfacing with safety modules.
.
29. UART APPLICATIONS
• Microcontroller Communication: Connecting MCUs (e.g., Arduino, ESP32,
STM32) to peripherals or other MCUs.
• Firmware Uploading: Programming microcontrollers using UART bootloaders
(e.g., Arduino via USB-UART).
• GPS Modules: Many GPS receivers (e.g., NEO-6M) use UART to transmit data to a
microcontroller.
• LoRa & Zigbee Devices: UART is used for configuring and transmitting data over
long-range networks.
• USB to Serial Converters: Used in USB-UART bridges (FTDI, CP2102, CH340) to
connect microcontrollers to PCs.