PWM Generator With Duty Cycle Control

Category: PIC12F675

Designer: RANA MUHAMMAD ADNAN KHALIL

Notes

The circuit is simulated in Proteus 7.10. While code is written in MpLab X IDE using XC8 compiler. The microcontroller used in this project is PIC12F675. The working of this project is given below. 1. This circuit controls the duty cycle and time period of PWM manually. 2. The viariable which is at right side controls the time period as shown in animation. 3. The viariable which is at left side controls the duty cycle as shown in animation. 4. The PIC12F675 does not have PWM module. Therefore, PWM is generating by bit banging method using Timer0. 5. The micro controller takes the input from variables and convert the input into percentage (0 to 100), both the time period and the duty cycle. 6. The microcontroller has 10 bit adc, so adc value can be between 0 to 1023. 7. The Adc value 0 to 1023 is scaled between 0 to 100 (percentage) and then duty cycle and time period are controlled according to that. Applications: 1. This circuit can be used as PWM generator. 2. You can convert this manual control of PWM to Auto control of PWM as a feedback. 3. Variable resistors (potentiometers) can be replaced with Op-Amps for feedback to control the duty cycle and time period. 4. This circuit can be used as a frequency generator. 5. It can be used in many ways, it depends on the application and how you use this circuit. You can view the program files in application to get the idea or you can download all the files to make further changes in it. All files are free!

Back to all circuits