I am new to this forum and i wanted to know how i can generate variable frequency using the ATMega16 microcontroller. I want to generate PWM signal whose frequency can be varied from 2Hz to 2.5kHz using the push buttons.
Will you have just 50% duty cycle or will you vary duty cycle as well?
Have you gone through the datasheet and taken a look at the CMO module and the PWM modes of operation? If not, here's the datasheet: www.atmel.com/Images/doc2466.pdf
Will you have just 50% duty cycle or will you vary duty cycle as well?
Have you gone through the datasheet and taken a look at the CMO module and the PWM modes of operation? If not, here's the datasheet: www.atmel.com/Images/doc2466.pdf
Thanks for your reply. I have read the PWM Modes in the datasheets few times and i am not able to exactly figure out what i need to do.
I need to vary the frequency in steps of 1Hz (2Hz to 2.5kHz) and duty cycle from 1-100%. I want to control both the parameters taking the input from the user.
I am using ATMega16 with 16MHz crystal.