I am working on a simple circuit consisting of AT89S52 and two push buttons as input. The output is PWM wave to be fed to a load.
I am stuck at the programing part.
1. I want to generate PWM output of frequency 3KHz.
2. When the circuit will be switched on the duty cycle of PWM will be 100%.
3. If we press increase then the duty cycle of the PWM will increase by 10% of the previous value. (MAX Value of duty cycle is 100% i.e ON condition)
4. If we press decrease then the duty cycle of the PWM will decrease by 10% of the previous value. (MIN value is 0% i.e OFF condition)
5. The PWM output should be available at all the time even if we release the button.
The hardware arrangement is as shown...
I am stuck at the programing part.
1. I want to generate PWM output of frequency 3KHz.
2. When the circuit will be switched on the duty cycle of PWM will be 100%.
3. If we press increase then the duty cycle of the PWM will increase by 10% of the previous value. (MAX Value of duty cycle is 100% i.e ON condition)
4. If we press decrease then the duty cycle of the PWM will decrease by 10% of the previous value. (MIN value is 0% i.e OFF condition)
5. The PWM output should be available at all the time even if we release the button.
The hardware arrangement is as shown...
Attachments
-
35.6 KB Views: 50