SlideShare a Scribd company logo
1 of 17
Gujarat Technological University
Chandkheda,Ahmedabad
GOVERNMENT ENGINEERING COLLEGE-RAJKOT
B. E.
(Electronics & Comunication Engineering Department)
PPT OF AVR TIMER PWM MODE BY,
DOSHI BHAVYA
PWM
• PWM is the abbreviation of Pulse Width
Modulation.
• It is used to generate a pulse train with varying
duty cycle.
• In the AVR, the timer/counter are used to
generate PWM signals.
• To change the PWM base frequency, the timer
clock frequency and top counter value is
changed. Faster clock and lower top value will
increase the PWM base frequency or timer
overflow frequency.
PWM MODE in AVR.
FAST PWM MODE.
• The fast pulse width
modulation or fast PWM
mode (WGM01:0=3)
provides a high frequency.
• PWM waveform generation
option.
• The fast PWM differs from
the other PWM option by
its signal-slop operation.
• The counter counts from
BOTTOM to MAX then
restarts from BOOTM.
PHASE CORRECT PWM MODE.
• The phase correct PWM
mode (WGM01:0=1) provides
a high resolution phase
correct PWM.
• Waveform generation option.
• The phase correct PWM
mode is based on a dual
slope operation.
• The counter counts
repeatedly from BOTTOM to
MAX and from MAX to
BOTTOM.
FAST PWM MODE.
• In the Fast PWM, the counter counts like it
does in the Normal mode. After the timer is
started, it starts to count up. It counts up until
it reaches its limit of 0xFF. When it rolls over
from 0xFF to 00, it sets HIGH the TOV0 flag.
Frequency of the generated wave in Fast PWM mode.
• In Fast PWM mode, the timer counts from 0 to top and then rolls
over. So frequency of generated wave is 1/256 of the frequency of
timer clock.
• N = determined by the prescaler.
Duty cycle of the generated wave in Fast PWM mode.
Non-Inverted: Inverted:
Example.
• Assuming XTAL=8MHz , using non-inverted mode, write a
program that generates a wave with frequency of 31,250 Hz
and duty cycle of 75%.
• Solution:
PHASE CORRECT PWM MODE.
• In Phase correct PWM, the TCNT0 goes up-
down. First it counts up until it reaches the
top value. Then it counts down until it reaches
zero. The TOV0 flag is set whenever it reaches
zero.
Frequency of the generated wave in
Phase Correct PWM mode.
• For Phase Correct PWM mode the frequency of generated wave
is 1/510 of the frequency of timer clock.
• The frequency generated in phase correct pwm mode is half of
the frequency generated in fast pwm mode.
Duty cycle of the generated wave in
Phase Correct PWM mode.
Non-Inverted mode: Inverted mode:
Example:
• Assuming XTAL=8MHz , using non-inverted mode, write a
program that generates a wave with frequency of 15,686 Hz
and duty cycle of 75%.
• Solution:
THANK YOU

More Related Content

Similar to Microprocessor and Controller

Speed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueSpeed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueRITESH D. PATIL
 
A Novel Pulse Shift Modulation Technique for Controlling
A Novel Pulse Shift Modulation Technique for ControllingA Novel Pulse Shift Modulation Technique for Controlling
A Novel Pulse Shift Modulation Technique for ControllingSaravanan_Sara17
 
Analog pulse modulation scheme.pptx
Analog pulse modulation scheme.pptxAnalog pulse modulation scheme.pptx
Analog pulse modulation scheme.pptxswatihalunde
 
PWM_LDT20CDT222222222222222222222222.pdf
PWM_LDT20CDT222222222222222222222222.pdfPWM_LDT20CDT222222222222222222222222.pdf
PWM_LDT20CDT222222222222222222222222.pdfDuyKhng31
 
Speed Control of Synchronous Motor
Speed Control of Synchronous Motor Speed Control of Synchronous Motor
Speed Control of Synchronous Motor Ashutosh Jha
 
Digital PWM technique for increased resolution
Digital PWM technique for increased resolutionDigital PWM technique for increased resolution
Digital PWM technique for increased resolutionuzairarshad16
 
Lecture Notes: EEEC6440315 Communication Systems - Pulse Time Modulation
Lecture Notes:  EEEC6440315 Communication Systems - Pulse Time ModulationLecture Notes:  EEEC6440315 Communication Systems - Pulse Time Modulation
Lecture Notes: EEEC6440315 Communication Systems - Pulse Time ModulationAIMST University
 
Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases
Raspberry Pi - Lecture 4 Hardware Interfacing Special CasesRaspberry Pi - Lecture 4 Hardware Interfacing Special Cases
Raspberry Pi - Lecture 4 Hardware Interfacing Special CasesMohamed Abdallah
 
Unit- 4 inverters (part-2)
Unit- 4 inverters (part-2)Unit- 4 inverters (part-2)
Unit- 4 inverters (part-2)johny renoald
 

Similar to Microprocessor and Controller (20)

Speed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM TechniqueSpeed Control Of DC motor By Using PWM Technique
Speed Control Of DC motor By Using PWM Technique
 
Ec8791 lpc2148 pwm
Ec8791 lpc2148 pwmEc8791 lpc2148 pwm
Ec8791 lpc2148 pwm
 
A Novel Pulse Shift Modulation Technique for Controlling
A Novel Pulse Shift Modulation Technique for ControllingA Novel Pulse Shift Modulation Technique for Controlling
A Novel Pulse Shift Modulation Technique for Controlling
 
Analog pulse modulation scheme.pptx
Analog pulse modulation scheme.pptxAnalog pulse modulation scheme.pptx
Analog pulse modulation scheme.pptx
 
Microcontroller part 3
Microcontroller part 3Microcontroller part 3
Microcontroller part 3
 
Unit 5 (13-05-23).pdf
Unit 5 (13-05-23).pdfUnit 5 (13-05-23).pdf
Unit 5 (13-05-23).pdf
 
PWM_LDT20CDT222222222222222222222222.pdf
PWM_LDT20CDT222222222222222222222222.pdfPWM_LDT20CDT222222222222222222222222.pdf
PWM_LDT20CDT222222222222222222222222.pdf
 
Speed Control of Synchronous Motor
Speed Control of Synchronous Motor Speed Control of Synchronous Motor
Speed Control of Synchronous Motor
 
Digital PWM technique for increased resolution
Digital PWM technique for increased resolutionDigital PWM technique for increased resolution
Digital PWM technique for increased resolution
 
22 PulseModulation.pdf
22 PulseModulation.pdf22 PulseModulation.pdf
22 PulseModulation.pdf
 
PWM_F09.ppt
PWM_F09.pptPWM_F09.ppt
PWM_F09.ppt
 
Ahmed.ppt
Ahmed.pptAhmed.ppt
Ahmed.ppt
 
Lecture Notes: EEEC6440315 Communication Systems - Pulse Time Modulation
Lecture Notes:  EEEC6440315 Communication Systems - Pulse Time ModulationLecture Notes:  EEEC6440315 Communication Systems - Pulse Time Modulation
Lecture Notes: EEEC6440315 Communication Systems - Pulse Time Modulation
 
PWM in ARM LPC2148.pptx
PWM in ARM LPC2148.pptxPWM in ARM LPC2148.pptx
PWM in ARM LPC2148.pptx
 
Unit iv-inverters-new
Unit iv-inverters-newUnit iv-inverters-new
Unit iv-inverters-new
 
Pwm ppm no1
Pwm ppm no1Pwm ppm no1
Pwm ppm no1
 
Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases
Raspberry Pi - Lecture 4 Hardware Interfacing Special CasesRaspberry Pi - Lecture 4 Hardware Interfacing Special Cases
Raspberry Pi - Lecture 4 Hardware Interfacing Special Cases
 
Unit- 4 inverters (part-2)
Unit- 4 inverters (part-2)Unit- 4 inverters (part-2)
Unit- 4 inverters (part-2)
 
Seminar302
Seminar302Seminar302
Seminar302
 
G010334953
G010334953G010334953
G010334953
 

More from BHAVYA DOSHI

Learning form legends
Learning form legendsLearning form legends
Learning form legendsBHAVYA DOSHI
 
Analog and Digital Communication
Analog and Digital CommunicationAnalog and Digital Communication
Analog and Digital CommunicationBHAVYA DOSHI
 
Teamwork and Harmony
Teamwork and HarmonyTeamwork and Harmony
Teamwork and HarmonyBHAVYA DOSHI
 

More from BHAVYA DOSHI (7)

Learning form legends
Learning form legendsLearning form legends
Learning form legends
 
Failures
FailuresFailures
Failures
 
Analog and Digital Communication
Analog and Digital CommunicationAnalog and Digital Communication
Analog and Digital Communication
 
Python programing
Python programingPython programing
Python programing
 
Teamwork and Harmony
Teamwork and HarmonyTeamwork and Harmony
Teamwork and Harmony
 
Interview skills
Interview skillsInterview skills
Interview skills
 
Air pollution
Air pollutionAir pollution
Air pollution
 

Recently uploaded

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

Microprocessor and Controller

  • 1. Gujarat Technological University Chandkheda,Ahmedabad GOVERNMENT ENGINEERING COLLEGE-RAJKOT B. E. (Electronics & Comunication Engineering Department) PPT OF AVR TIMER PWM MODE BY, DOSHI BHAVYA
  • 2. PWM • PWM is the abbreviation of Pulse Width Modulation. • It is used to generate a pulse train with varying duty cycle. • In the AVR, the timer/counter are used to generate PWM signals. • To change the PWM base frequency, the timer clock frequency and top counter value is changed. Faster clock and lower top value will increase the PWM base frequency or timer overflow frequency.
  • 3.
  • 4. PWM MODE in AVR. FAST PWM MODE. • The fast pulse width modulation or fast PWM mode (WGM01:0=3) provides a high frequency. • PWM waveform generation option. • The fast PWM differs from the other PWM option by its signal-slop operation. • The counter counts from BOTTOM to MAX then restarts from BOOTM. PHASE CORRECT PWM MODE. • The phase correct PWM mode (WGM01:0=1) provides a high resolution phase correct PWM. • Waveform generation option. • The phase correct PWM mode is based on a dual slope operation. • The counter counts repeatedly from BOTTOM to MAX and from MAX to BOTTOM.
  • 5. FAST PWM MODE. • In the Fast PWM, the counter counts like it does in the Normal mode. After the timer is started, it starts to count up. It counts up until it reaches its limit of 0xFF. When it rolls over from 0xFF to 00, it sets HIGH the TOV0 flag.
  • 6.
  • 7.
  • 8. Frequency of the generated wave in Fast PWM mode. • In Fast PWM mode, the timer counts from 0 to top and then rolls over. So frequency of generated wave is 1/256 of the frequency of timer clock. • N = determined by the prescaler.
  • 9. Duty cycle of the generated wave in Fast PWM mode. Non-Inverted: Inverted:
  • 10. Example. • Assuming XTAL=8MHz , using non-inverted mode, write a program that generates a wave with frequency of 31,250 Hz and duty cycle of 75%. • Solution:
  • 11. PHASE CORRECT PWM MODE. • In Phase correct PWM, the TCNT0 goes up- down. First it counts up until it reaches the top value. Then it counts down until it reaches zero. The TOV0 flag is set whenever it reaches zero.
  • 12.
  • 13.
  • 14. Frequency of the generated wave in Phase Correct PWM mode. • For Phase Correct PWM mode the frequency of generated wave is 1/510 of the frequency of timer clock. • The frequency generated in phase correct pwm mode is half of the frequency generated in fast pwm mode.
  • 15. Duty cycle of the generated wave in Phase Correct PWM mode. Non-Inverted mode: Inverted mode:
  • 16. Example: • Assuming XTAL=8MHz , using non-inverted mode, write a program that generates a wave with frequency of 15,686 Hz and duty cycle of 75%. • Solution:

Editor's Notes

  1. An analog filter can be used to shape the digital PWM output to obtain an analog signal such as sine wave