Here's the HPWM code I use to drive Contrast...
Code:
SetLCDContrast:
DataA=Contrast*40
HPWM 2,DataA,1000
Return
DataA is a byte variable. Contrast is a User software selectable value between 1 and 5. The factory default is 2.
A Capacitor is a waste of real-estate. Your eye can't distinguish 30Hz (TV picture frame rate) let alone 1kHz as used above... your LCD probably can't switch that fast either. How fast is your LCD monitor... 3mS? - mine's closer to 9.
As always, try it on a breadboard with your chosen LCD before you commit to PCB... I've used it sucessfully on dozens of different PowerTip and Tri-T LCD's without problems.
If you have a couple of PWM channels, use the other one for the Backlight... same code... do a Search for Easy Backlight.
Bookmarks