Hi,
Main issue is pic 16f676 doesn't have inbuilt PWM module. So mikroC pro also doesn't have library for the same. So i have to use software PWM. So plz tell logic for that.
- - - Updated - - -
Hi,
Main issue is pic 16f676 doesn't have inbuilt PWM module. So mikroC pro also doesn't have library for the same. So i have to use software PWM. So plz tell logic for that.
Use two timers. One to toggle an output pin and another to generate delay time for toggling. delay time decides pulse width. First timer decides pulse frequency.
Yes. The LED intensity is set by the PWM duty cycle. The software PWM does allow for duty cycle setting (if it didn't, it would be useless). So, adjust the duty cycle of the software PWM to adjust the intensity.
Also, if you're interested in hardware PWM, take a look at PIC16F684. It's very similar to the PIC16F676 but has an extra CCP module that you can use for hardware PWM.
I have implemented hardware PWM in PIC 16f72. Now m working on a solar panel project using 16f676 which doesn't have hardware PWM and in which i have to maintain constant voltage across the load which is sure array of LED's. So when voltage of battery comes down up to 9 v from say 12 v, LED's should glow with the same intensity.
Adjust the duty cycle to give constant 'average' voltage. Say, if you wanted a certain intensity at 12V, you need 50% duty cycle. So, that's an average voltage of 6V. To maintain the same intensity at 9V, you'll need the same 'average' voltage. So, your duty cycle must be increased to 6/9 * 100% = 66.7%
I am trying, but dont know wts happening, load is not getting off when solar panel ADC value is incresing. I have taken minimum value for it '1' but still not working. Don't know wt wrong i am doing.