You are on page 1of 13

PWM

Pulse width modulation reduces the average power delivered by an


electrical signal by converting the signal into discrete parts. In the PWM
technique, the signal’s energy is distributed through a series of pulses
rather than a continuously varying (analogue) signal.
How is a Pulse Width Modulation Signal generated?
A pulse width modulating signal is generated using a comparator. The
modulating signal forms one part of the input to the comparator, while
the non-sinusoidal wave or sawtooth wave forms the other part of the
input. The comparator compares two signals and generates a PWM
signal as its output waveform.

Duty Cycle of PWM


As we know, a PWM signal stays “ON” for a given time and stays
“OFF” for a certain time. The percentage of time for which the signal
remains “ON” is known as the duty cycle. If the signal is always “ON,”
then the signal must have a 100 % duty cycle. The formula to calculate
the duty cycle is given as follows:

The average value of the voltage depends on the duty cycle. As a result,
the average value can be varied by controlling the width of the “ON” of
a pulse.
Frequency of PWM
The frequency of PWM determines how fast a PWM completes a
period. The frequency of a pulse is shown in the figure above.
The frequency of PWM can be calculated as follows:
Frequency = 1/Time Period
Time Period = On Time + OFF time
Output Voltage of PWM signal
The output voltage of the PWM signal will be the percentage of the duty
cycle. For example, for a 100% duty cycle, if the operating voltage is 5
V then the output voltage will also be 5 V. If the duty cycle is 50%, then
the output voltage will be 2.5 V.
Types of Pulse Width Modulation Technique
There are three conventional types of pulse width modulation technique
and they are named as follows:
 Trail Edge Modulation – In this technique, the signal’s lead edge
is modulated, and the trailing edge is kept fixed.
 Lead Edge Modulation – In this technique, the signal’s lead edge
is fixed, and the trailing edge is modulated.
 Pulse Center Two Edge Modulation – In this technique, the pulse
centre is fixed and both edges of the pulse are modulated.
Applications of Pulse Width Modulation
 The pulse width modulation technique is used in
telecommunication for encoding purposes.
 The PWM helps in voltage regulation and therefore is used to
control the speed of motors.
 The PWM technique controls the fan inside a CPU of the
computer, thereby successfully dissipating the heat.
 PWM is used in Audio/Video Amplifiers.

COMMUNICATION PROTOCOLS
The proper descriptions of digital message formats as well as rules are
known communication protocols. The main function of these protocols
is to exchange messages from one computer system to another. These
are significant in telecommunications systems as they consistently send
and receive messages. These protocols cover error detection &
correction, signaling, and authentication. They can also explain the
semantics, syntax & brings analog & digital communications together.
The implementation of these protocols can be done within hardware as
well as software. So communications protocols are available around
thousand types which are used all over in analog & digital
communications, so computer networks cannot be present without them.
“A set of rules and regulations that allow two electronic devices to
connect to exchange the data with one and another.”
Types of Communication Protocols
There are two types of communication protocols which are classified
below:
 Inter System Protocol
 Intra System Protocol
Inter System Protocol
The inter-system protocol using to communicate the two different
devices. Like communication between computer to microcontroller kit.
The communication is done through an inter bus system.
The different categories of intersystem protocol mainly include the
following.
 UART Protocol
 USART Protocol
 USB Protocol
UART Protocol
UART stands for a universal asynchronous transmitter and receiver.
UART Protocols is a serial communication with two wired protocols.
The data cable signal lines are labeled as Rx and Tx. Serial
communication is commonly used for transmitting and receiving the
signal. It is transferred and receives the data serially bit by bit without
class pulses. The UART takes bytes of data and sends the individual bits
in a sequential manner.
UART is a half-duplex protocol. Half-duplex means transferring and
receiving the data but not at the same time. Most of the controllers have
hardware UART on board. It uses a single data line for transmitting and
receiving the data. It has one start bit, 8-bit data and a one-stop bit mean
the 8-bit data transfer one’s signal is high to low.
Ex: Emails, SMS, Walkie-talkie.
USART Protocol
USART stands for a universal synchronous and asynchronous
transmitter and receiver. It is a serial communication of a two-wire
protocol. The data cable signal lines are labeled as Rx and TX. This
protocol is used to transmitting and receiving the data byte by byte
along with the clock pulses. It is a full-duplex protocol that means
transmitting and receiving data simultaneously to different board rates.
Different devices communicate with microcontroller to this protocol.
Ex:-Telecommunications.

USB Protocol
USB stands for universal serial bus. It is a serial communication of two-
wire protocol. The data cable signal lines are labeled D+ and D-. This
protocol is used to communicate with the system peripherals. USB
protocol is used to send and receive the data serially to the host and
peripheral devices. USB communication requires driver software that is
based on the functionality of the system. USB devices can transfer data
on the bus without any request on the host computer.
Ex: Mouse, Keyboard, Hubs, switches, pen drive.
Differences Between the Inter System Protocols
The intersystem protocols mainly include UART, USART, and USB

UART USART USB


The term USART stands for
The term UART stands for Universal Synchronous and
Universal Asynchronous Asynchronous Data Transmitter The term USB stands for
Transmitter and Receiver and Receiver Universal Serial Bus
UART mainly includes two
wire-based protocols like USART is a two-wire protocol USB is a two-wire protocol like
transmitter and receiver like Transmitter and Receiver D+ & D-
It transmits as well as receives
pockets of data by byte without It transmits and receives a block It transmits and receives the data
classes pulse of data through classes pulses through clock pulses
UART is a half-duplex USART is a full-duplex USB is also full-duplex
communication communication communication
UART is slow as compared to USART is slow as compared to It is fast as compared to USART
USART USB and UART

Intra System Protocol


The Intra system protocol is used to communicate the two devices
within the circuit board. While using these intra system protocols,

without going to intrasystem protocols we will expand the peripherals of


the microcontroller. The circuit complexity and power consumption will
be increased by using the intrasystem protocol. Using intra system
protocols circuit complexity and power consumption, the cost is
decreased and it is very secure to accessing the data
The different categories of intrasystem protocol mainly include the
following.
 I2C Protocol
 SPI Protocol
 CAN Protocol
I2C Protocol
I2C stands for the inter-integrated circuit and it requires only two wires
connecting all peripherals to the microcontroller. I2C requires two wires
SDA (serial data line) and SCL (serial clock line) to carry information
between devices. It is a master to a slave communication protocol. Each
slave has a unique address. The master device sends the address of the
target slave device and reads/writes the flag. The address matches any
slave device that the device is ON, the remaining slave devices are
disabled mode.
Once the address is match communication proceed between the master
and that slave device and transmitting and receiving the data. The
transmitter sends 8-bit data, the receiver replies 1-bit of
acknowledgment. When the communication is completed master issues
the stop condition. The I2C bus was developed by Philips
Semiconductors. Its original purpose is to provide an easy way to
connect CPU to peripherals chips.
Peripheral devices in embedded systems are often connected to the
microcontroller as memory-mapped devices. I2C requires only two
wires for connecting all the peripherals to the microcontroller. These
active wires, called SDA and SCL, are both bidirectional. SDA line is a
serial data line and the SCA line is a serial clock line.
I2C Pull-up Resistors
Why given the pull-up resistors in I2C SCL and SDA line.
 Both SDA and SCL lines are open-drain drivers.
 It can drive output low canot driver it high.
 For the lines to be able to go high you must provide pull-up
resistors

Advantages of I2C protocol


 Simple and effective
 It occupies less space as it directly connects the components and
reduces the cost of interconnection
 It supports multi-mastering, i.e., any device that can send or receive
data can be a master
 The ACK/NACK feature supports a robust error handling mechanism

Disadvantages of I2C protocol


 Hardware, especially software implementation, is more complicated
than the SPI Half-duplex
 Not scalable for a large number of devices
 It takes up much more real estate on a PCB as it uses pull-up resistors

SPI Protocol
SPI stands for the serial peripheral interface. It is one of the serial
communication protocol developed by Motorola. Sometimes SPI
protocol is also called a 4-wire protocol. It requires four wires MOSI,
MISO, SS, and SCLK.SPI protocol used to communicate the master and
slave devices. The master first configures the clock using a frequency.
The master then selects the particular slave device for communication
by pulling the chip select button. That particular device is selected and
starts the communication between the master and that particular slave.
The master selects only one slave at a time. It is a full-duplex
communication protocol. Not limited to 8-bit words in the case of bit
transferring.
Advantages of SPI protocol
1. No start and stop bit required
2. No complicated slave communicating system
3. Higher data transfer rate than I2C protocol (almost double)
4. Separate MOSI and MISO pins to simultaneously transmit and
receive data
Disadvantages of SPI protocol
1. It uses four wires, whereas I2C and UART use two wires only
2. No acknowledgment from the receiver after the reception of data
3. It allows only a single master

CAN Protocol
CAN stands for the controller area network. It is a serial communication
protocol. It requires two wires CAN High (H+) and CAN low (H-).  It
was developed by the Robert bosh company in 1985 for in-vehicle
networks. It is based on a message-oriented transmission protocol.
Advantages of CAN protocol
1. It is a low-cost solution as the number of wires used reduces
compared to old communication models in automotive and thus
reduces vehicle weight
2. It is a fast way of communicating between different control
modules and sensors as it supports a data transfer rate of 1 Mbit/s
at a bus length of 40m
3. It provides highly reliable transmission by offering an excellent
error-detection and error-handling mechanism. It is also immune to
electromagnetic interference.
4. It can auto retransmit the same message if any device does not
receive a notification
Disadvantages of CAN protocol
1. It lacks encryption and authentication mechanisms
2. It is limited to a maximum of 64 nodes or devices
3. The cost of development and maintenance of software is high
Differences Between the Intra System Protocols
The intra system protocols mainly include I2C, SPI, and CAN
I2C SPI CAN
I2C is an inter-integrated SPI stands for serial The CAN stands for
circuit peripheral interface controller area network
It is implemented by SPI is developed by CAN is developed by
Philips Motorola Bosch
I2C is a half-duplex SPI is a full-duplex CAN is a full-duplex
protocol protocol protocol
Synchronization Synchronization Synchronization
It is a four-wire protocol It is a two-wire protocol
It is a two-wire protocol like SCL, MISO, MOSI like CANH+ and CAN
like SCL & SDL & SS H-
It is a multi-master It is a single master It is a multi-master
protocol protocol protocol
It is used in the circuit It is used in the circuit It is used in two circuit
board board board

You might also like