Easy LCD Contrast
by
Published on - 1st June 2010 05:02
Number of Views: 4727
Here's a useful and very simple way of controlling the contrast on an LCD with just two Resistors and a line of code. If the PIC in your project has an unused available PWM channel (eg 16F628, F876 etc etc), then this will enable you to control your LCD's contrast over it's usable range and at absolute minimum cost.
HPWM 1,Contrast,1000
Where Contrast is a byte variable in the range 0-125. Steps of 25 seem to be adequate (ie Contrast=0, 25, 50, 75,100 or 125) where zero is maximum and 125 is minimum. Stepping above 125 is pointless as your display will disappear into obscurity.
The value for Resistors R1 and R2 I've set at 1K5, mainly because I've been told we have almost 2 million of that value in stock and please can I find a way of getting rid of them. Decreasing R2 to say 680R will increase the bottom-end contrast, but the software variable Contrast might need larger steps (say steps of 40) and increased span (eg 0-240).
You really don't get much cheaper or simpler than this...
Melanie
Re: Serin Not Recognizing Qualifier From Another PIC
Hi Amgen,
JESmitter Yesterday, 15:57Thanks for the reply. Yes, ProgIDRx is cleared. And its value is $A (or10). But, I haven't been able to receive it yet because nothing is being received. SERIN always exits upon the 5...