Академический Документы
Профессиональный Документы
Культура Документы
Jan-9th-2009
In the figure you can see a PWM signal. As you can see it is just a digital signal (can easily be generated by MCUs). But let me
clarify some of its properties.
The signal remains "ON" for some time and "OFF" for some time.
Ton = Time the output remains high.
Toff = Time the output remains Low.
When output is high the voltage is 5v'
When output is low the voltage is 0v
T = Time Period = Ton + Toff
Duty Cycle.
It is defined by
So you can see it is just the percentage of the total time the output was high. In the above figure (Fig. 1) you can see that Ton =
Toff = Half of the time period. So the duty cycle is 50%. If the frequency of such wave is sufficiently high (say 500 Hz) the output
you get is half of 5v i.e. 2.5 volts. Thus if this output is connected to a motor(by means of suitable drivers) it will run at 50% of
its full speed at 5v. The PWM technique utilizes this fact to generate any voltage between two extremes (for example between
0-12volts). The trick is to vary the duty cycle between 0-100% and get same percentage of input voltage to output. Below are
some examples of PWM signals of different duty cycle.
Fig. 2- A PWM Waveform. Duty Cycle = 12.5% Analog Voltage Out = 12.5% of Vcc (5v) = 0.625 Volts
Fig. 3- A PWM Waveform. Duty Cycle = 75% Analog Voltage Out = 75% of Vcc (5v) = 3.75 Volts
So you just saw how we can generate analog voltage levels from a digital system using PWM technique. If the output is
provided with an R/C filter you will get a pure DC signals levels instead of square waves. But this isn't required for driving
motors or controlling LED's brightness. You can feed the PWM signals directly to then (by directly I mean without the R/C filter
and not the drivers (like transistor etc)).
In the next tutorial we will see how to actually generate PWM signals from an AVR MCU. Till then good bye. But don't forget
to leave your comment ! May be you have some doubts, request or any feedback, feel free to say !
This entry was posted on Friday, January 9th, 2009 at 4:11 pm and is filed under AVR Tutorials. You can follow any responses to this entry through
the RSS 2.0 feed. You can leave a response, or trackback from your own site.
1. 1
PWM Signal Generation by Using AVR Timers. | eXtreme Electronics Says:
[...] the last tutorial you saw how the PWM technique helps us generate analog signals from a microcontroller. In this [...]
Hi Avinash,
Do you have any suggestions about how this might be applied to decoding infra-red protocols?
Cheers,
Paul
Hello Paul,
thanks for putting up the info, you have great tutorials. they are short and have just enough info not to complicate noobs!
great work and thank you again for sharing!
Hey, i am using a dsp for my project. Can you pls help me by showing me how to generate a PWM for a DSP 56F807.
Thanks
Hi Avinash,
Thanks a lot .
Actually becoz of ur tutorials i came to know the clear clarification regarding PWM.its helped me so much.
And wishing u a very bright future.
Leave a Reply
Name (required)
Website
Submit Comment
New Products
Tags
Meta
New Products
Tags
avrs xBoard electronics Seven Segment Timer0 timer1 Multiplexing internal peripherals programming ir ADC
isr atmega8 hi-tech hi-tech c PIC Development Board i2c pwm Hyperterminal microcontrollers USB
Programmer avr gcc avr programmer c interrupt lcd mplab usb pic programmer Timer mcu USART
rs232 atmega16 pic tutorial pic programmer atmega32 pic16f pic16f877 pic18 pic18f
microchip pic18f2550 pic18f4550 pic AVR
Meta
Log in
RSS
Comments RSS
Wordpress
Valid XHTML
Recent Post
Comments
Video
Recent Post
Interfacing DS1307 RTC Chip with AVR Microcontroller
Interfacing LCD Modules with PIC Microcontrollers.
AVR Project – Relay Timer with ATmega8 AVR MCU
AVR Development Board – Assembly Instructions
RF Communication Between Microcontrollers – Part II
Comments
kishen: really good tutorial thx a lot really helped
ankita: dis was realy helpful… but can we do the same ussing pic16f876a???? how to include...
andy: Hi, Nice tuto, could you show me how to setting about clock source for AVR…? I used...
Bob Cousins: Hi there, In your wiring diagram you have VSS and VDD connected the wrong way. VSS...
Diego: I fine great your software….If you want I can help to translate your software to spanish...
Fernando Machado: Very nice job! Well done and free!
sAnuB sAliM: Thanxz dude…. This site is very useful to the beginners…. Thank u…...
Video
Categories
AVR Development Board
AVR Projects
AVR Tutorials
Code Libraries
Code Snippets
Hardwares
Microchip PIC Tutorials
PIC Development Board
Programming in 'C'
RF
Software
Tools
Navigation
Home
Forum
Shop
Links
Subscribe
Get New Articles Deliverd To Your Inbox!
Email address:
Subscribe
Delivered by FeedBurner
Recent Posts
Interfacing DS1307 RTC Chip with AVR Microcontroller
Interfacing LCD Modules with PIC Microcontrollers.
AVR Project – Relay Timer with ATmega8 AVR MCU
AVR Development Board – Assembly Instructions
RF Communication Between Microcontrollers – Part II
Programming in C – Tips for Embedded Development.
RF Communication Between Microcontrollers – Part I
Comments
kishen: really good tutorial thx a lot really helped
ankita: dis was realy helpful… but can we do the same ussing pic16f876a???? how to include...
andy: Hi, Nice tuto, could you show me how to setting about clock source for AVR…? I used...
Bob Cousins: Hi there, In your wiring diagram you have VSS and VDD connected the wrong way. VSS...
Diego: I fine great your software….If you want I can help to translate your software to spanish...
Fernando Machado: Very nice job! Well done and free!
sAnuB sAliM: Thanxz dude…. This site is very useful to the beginners…. Thank u…...