If I remove the defines I get the same results, which is nothing.
And yes, 16F876A for CodeDesigner Lite & ICProg.
If I remove the defines I get the same results, which is nothing.
And yes, 16F876A for CodeDesigner Lite & ICProg.
mmm how about the frequency? @20MHZ the minimum should be 'round 1.2KHZ if you're using HPWM.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Here are the subs I'm using.
; -----[ LCD Contrast PWM ]-----------------------------------------
PWM_Contrast:
value=Contrast*40
HPwm 1,value,1000
Return
; -----[ LCD Backlight PWM ]----------------------------------------
PWM_BackLight:
value=Backlight*51
HPwm 2,value,1000
Return
As i said, the minimum frequency should be 1.2Khz. 1.3KHZ work fine here. So change it to...
About now?Code:-----[ LCD Contrast PWM ]----------------------------------------- PWM_Contrast: value=Contrast*40 HPwm 1,value,1300 Return ; -----[ LCD Backlight PWM ]---------------------------------------- PWM_BackLight: value=Backlight*51 HPwm 2,value,1300 Return
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Of course, you are correct changing to 1300 worked. Which, now that I think about it, makes sense because I was using the internal 8mHz clock on the 16F88.
Thanks for the help, its my first time with PWM. Needless to say I will remember this in the future.
I may ask Melanie to make a note about this in here FAQ.
So my guess in the previous post #2 about SPBRG value was correct. You should modify it NOW!
And... the minimum frequency range is stated in the PBP manual... OUPS!
Glad to know it's working now.
Have fun!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I did the RTFM thing and saw the chart. I just didn't make the link mentally between the chart and my code. I will in the future.
Thanks!
Bookmarks