SlideShare a Scribd company logo
5
Most read
PWM Mode In Timer1
By: Habitamu Asimare
EMBEDDED SYSTEMS
PWM Mode In Timer1 1
PWM Concepts
• Usages of PWM
– Sound Output
– Control of Motor
– Dimming of LED
• Key Words
– Pulses
– Period
– Phase Correct PWM
– Duty Cycle
– Inverted and Non-Inverted
• Points Discussed
– PWM Timer 1
– Phase correct Timer 1 PWM
Pulse
Period
50%
Duty Cycle
Phase Correct PWM
22 PWM Mode In Timer1
PWM In Timer 1 Modes
• There are five types of modes in fast PWM
– Mode 5 (top = 0xFF)
– Mode 6 (top = 0x1FF)
– Mode 7 (top = 0x3FF)
– Mode 14 (top = ICR1)
– Mode 15 (top = OCR1A)
Mode WGM13 WGM12 WGM11 WGM10 Timer/Mode of operation
5 0 1 0 1 Fast PWM, 8 bit
6 0 1 1 0 Fast PWM, 9 bit
7 0 1 1 1 Fast PWM, 10 bit
14 1 1 1 0 Fast PWM
15 1 1 1 1 Fast PWM
In Inverted PWM
COM1A1 and COM1A0
will be high
In Non-Inverted PWM
only COM1A1 is high
3 PWM Mode In Timer1
Phase Correct PWM mode
• There are five phase correct PWM modes
– Mode 1
– Mode 2
– Mode 3
– Mode 10
– Mode 11
Mode WGM13 WGM12 WGM11 WGM10 Timer/Mode of operation
1 0 0 0 1 PWM, phase correct, 8 bit
2 0 0 1 0 PWM, phase correct, 9 bit
3 0 0 1 1 PWM, phase correct,10 bit
10 1 0 1 0 PWM, phase correct
11 1 0 1 1 PWM, phase correct
4
4 PWM Mode In Timer1
Fast PWM & Phase Correct
Fast PWM Phase Correct
Non
Inverted
Inverted
5
5 PWM Mode In Timer1
Example 1
Solution
• In Mode 5, WGM10 & WGM12 is high
• There is no pre-scalar then only CS10 is high
• It is non-inverted so, COM1A1 is high
• The value of TCCR1A is 0x81
• The value of TCCR1B is 0x09
6 PWM Mode In Timer1
Example 2
• Then We have to calculate
– OCR1A1 value from the formula non inverted mode, OCR1x =
((Top + 1)*duty_cylce/100)-1 = ((255+1)*75/100)-1 = 191
– TCCR1A = 0x81
– TCCR1B = 0x09
7 PWM Mode In Timer1
#include <avr/io.h>
int main(void)
{
DDRD |= (1<<5);
OCR1AH = 0;
OCR1AL = 191;
TCCR1A = 0X81;
TCCR1B = 0X09;
while (1);
return 0;
}
Example 3
– In mode 1, WGM10 is high
– It is none inverted and COM1A1 is high
– No pre-scalar and CS10 is high
– The value of TCCR1A is 0x81
– The value of TCCR1B is 0x01
8 PWM Mode In Timer1
Example 4
– The value of TCCR1A is 0x91
– The value of TCCR1B is 0x01
– OCR1Ax = 191
9 PWM Mode In Timer1
#include <avr/io.h>
int main(void)
{
DDRD |= (1<<5);
OCR1AH = 0;
OCR1AL = 191;
TCCR1A = 0X91;
TCCR1B = 0X01;
while (1);
return 0;
}
Question?
Thank You!
10 PWM Mode In Timer1

More Related Content

PPTX
PDF
Smart traffic light controller using verilog
PPTX
Lcd interfaing using 8051 and assambly language programming
PPTX
Clock divider by 3
DOCX
Altera flex
PDF
DSP Processor
PPTX
Pic16cxx instruction set
PPTX
CMOS LOGIC STRUCTURES
Smart traffic light controller using verilog
Lcd interfaing using 8051 and assambly language programming
Clock divider by 3
Altera flex
DSP Processor
Pic16cxx instruction set
CMOS LOGIC STRUCTURES

What's hot (20)

PPTX
Timer counter in arm7(lpc2148)
PPT
Interrupts for PIC18
PDF
Nyquist criterion for zero ISI
PDF
Embedded Systems (18EC62) - ARM - 32-Bit Microcontroller (Module 1)
DOC
PIC MICROCONTROLLERS -CLASS NOTES
PPT
PDF
Vlsi design
PPT
Adc interfacing
PPTX
Bicmos Technology - Overview
PPTX
Introduction to arm processor
PDF
Design of -- Two phase non overlapping low frequency clock generator using Ca...
PDF
Chapter4 - The Continuous-Time Fourier Transform
PPT
Ladder Intro Tutorial
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
PDF
8051-mazidi-solution
PPTX
Verilog HDL
PPTX
Rc delay modelling in vlsi
PPT
Real Time Operating system (RTOS) - Embedded systems
PPT
Multipliers in VLSI
Timer counter in arm7(lpc2148)
Interrupts for PIC18
Nyquist criterion for zero ISI
Embedded Systems (18EC62) - ARM - 32-Bit Microcontroller (Module 1)
PIC MICROCONTROLLERS -CLASS NOTES
Vlsi design
Adc interfacing
Bicmos Technology - Overview
Introduction to arm processor
Design of -- Two phase non overlapping low frequency clock generator using Ca...
Chapter4 - The Continuous-Time Fourier Transform
Ladder Intro Tutorial
Question paper with solution the 8051 microcontroller based embedded systems...
8051-mazidi-solution
Verilog HDL
Rc delay modelling in vlsi
Real Time Operating system (RTOS) - Embedded systems
Multipliers in VLSI
Ad

Similar to Pwm(Pulse Width Modulation) presentation (20)

PPTX
Microprocessor and Controller
PPTX
Timers and pwm
PDF
PWM_skgdfshkfdjkfgjsjienvdkncjdhrkshd.pdf
PDF
Microcontroller part 3
PPTX
pwm for speed control
PPTX
Dc Motor Speed Controller based on Pwm technique
PPTX
U III embedded system MOTION CONTROL QEI.pptx
PDF
Ece4760 hw4
PPT
PWM_F09.ppt
PPTX
Speed control of D.C motor using Pusle width modulation
PPTX
Digital PWM technique for increased resolution
PPTX
PWM in ARM LPC2148.pptx
PDF
AVR_Course_Day7 timers counters and interrupt programming
PPTX
pwm_puls width modulation chapteres.pptx
DOCX
Report on speed control of d.c. motor using pwm method
PPTX
Speed control of DC motor using pulse width modulation technique
PDF
A pwm modulator
PDF
Fq3510001006
PPT
Chapter 6 dc motor speed control
Microprocessor and Controller
Timers and pwm
PWM_skgdfshkfdjkfgjsjienvdkncjdhrkshd.pdf
Microcontroller part 3
pwm for speed control
Dc Motor Speed Controller based on Pwm technique
U III embedded system MOTION CONTROL QEI.pptx
Ece4760 hw4
PWM_F09.ppt
Speed control of D.C motor using Pusle width modulation
Digital PWM technique for increased resolution
PWM in ARM LPC2148.pptx
AVR_Course_Day7 timers counters and interrupt programming
pwm_puls width modulation chapteres.pptx
Report on speed control of d.c. motor using pwm method
Speed control of DC motor using pulse width modulation technique
A pwm modulator
Fq3510001006
Chapter 6 dc motor speed control
Ad

Recently uploaded (20)

PPTX
sap open course for s4hana steps from ECC to s4
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Approach and Philosophy of On baking technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Cloud computing and distributed systems.
PPTX
A Presentation on Artificial Intelligence
sap open course for s4hana steps from ECC to s4
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Approach and Philosophy of On baking technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Spectroscopy.pptx food analysis technology
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
Cloud computing and distributed systems.
A Presentation on Artificial Intelligence

Pwm(Pulse Width Modulation) presentation

  • 1. PWM Mode In Timer1 By: Habitamu Asimare EMBEDDED SYSTEMS PWM Mode In Timer1 1
  • 2. PWM Concepts • Usages of PWM – Sound Output – Control of Motor – Dimming of LED • Key Words – Pulses – Period – Phase Correct PWM – Duty Cycle – Inverted and Non-Inverted • Points Discussed – PWM Timer 1 – Phase correct Timer 1 PWM Pulse Period 50% Duty Cycle Phase Correct PWM 22 PWM Mode In Timer1
  • 3. PWM In Timer 1 Modes • There are five types of modes in fast PWM – Mode 5 (top = 0xFF) – Mode 6 (top = 0x1FF) – Mode 7 (top = 0x3FF) – Mode 14 (top = ICR1) – Mode 15 (top = OCR1A) Mode WGM13 WGM12 WGM11 WGM10 Timer/Mode of operation 5 0 1 0 1 Fast PWM, 8 bit 6 0 1 1 0 Fast PWM, 9 bit 7 0 1 1 1 Fast PWM, 10 bit 14 1 1 1 0 Fast PWM 15 1 1 1 1 Fast PWM In Inverted PWM COM1A1 and COM1A0 will be high In Non-Inverted PWM only COM1A1 is high 3 PWM Mode In Timer1
  • 4. Phase Correct PWM mode • There are five phase correct PWM modes – Mode 1 – Mode 2 – Mode 3 – Mode 10 – Mode 11 Mode WGM13 WGM12 WGM11 WGM10 Timer/Mode of operation 1 0 0 0 1 PWM, phase correct, 8 bit 2 0 0 1 0 PWM, phase correct, 9 bit 3 0 0 1 1 PWM, phase correct,10 bit 10 1 0 1 0 PWM, phase correct 11 1 0 1 1 PWM, phase correct 4 4 PWM Mode In Timer1
  • 5. Fast PWM & Phase Correct Fast PWM Phase Correct Non Inverted Inverted 5 5 PWM Mode In Timer1
  • 6. Example 1 Solution • In Mode 5, WGM10 & WGM12 is high • There is no pre-scalar then only CS10 is high • It is non-inverted so, COM1A1 is high • The value of TCCR1A is 0x81 • The value of TCCR1B is 0x09 6 PWM Mode In Timer1
  • 7. Example 2 • Then We have to calculate – OCR1A1 value from the formula non inverted mode, OCR1x = ((Top + 1)*duty_cylce/100)-1 = ((255+1)*75/100)-1 = 191 – TCCR1A = 0x81 – TCCR1B = 0x09 7 PWM Mode In Timer1 #include <avr/io.h> int main(void) { DDRD |= (1<<5); OCR1AH = 0; OCR1AL = 191; TCCR1A = 0X81; TCCR1B = 0X09; while (1); return 0; }
  • 8. Example 3 – In mode 1, WGM10 is high – It is none inverted and COM1A1 is high – No pre-scalar and CS10 is high – The value of TCCR1A is 0x81 – The value of TCCR1B is 0x01 8 PWM Mode In Timer1
  • 9. Example 4 – The value of TCCR1A is 0x91 – The value of TCCR1B is 0x01 – OCR1Ax = 191 9 PWM Mode In Timer1 #include <avr/io.h> int main(void) { DDRD |= (1<<5); OCR1AH = 0; OCR1AL = 191; TCCR1A = 0X91; TCCR1B = 0X01; while (1); return 0; }
  • 10. Question? Thank You! 10 PWM Mode In Timer1