http://www.picbasic.co.uk/forum/show...=Easy+Contrast
Actually, six years on from that post I standardised with 1K5 for R1 and 470R for R2... works well...
http://www.picbasic.co.uk/forum/show...=Easy+Contrast
Actually, six years on from that post I standardised with 1K5 for R1 and 470R for R2... works well...
Errrr.... seriously? It's that easy?
Melanie, you never fail to amaze me.
No need for a filter cap even? Any benefit to using one?
Any restrictions on the max/min PWM frequency?
Thanks VERY much for that tidbit. That's excellent.
Ahhh rats... now what am I going to do with all those digital pots I've got in stock?![]()
steve
Here's the HPWM code I use to drive Contrast...
DataA is a byte variable. Contrast is a User software selectable value between 1 and 5. The factory default is 2.Code:SetLCDContrast: DataA=Contrast*40 HPWM 2,DataA,1000 Return
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.
Thank you Melanie, that's great!
I'll give it a try as soon as I get a chance. It saves some expense, and a bit of real estate, and 1 PIC pin compared to the digital pot method. Very nice!
I'm already using the other PWM channel to drive a MOSFET for the backlight. I figured out how to do that several projects ago.
I'll give your circuit a test to make sure it works with my LCD before I commit to a run of boards, but it sounds like a very happy thing for my project.
Thanks ever so much for your help!
steve
Well I just tried Melanie's "Easy Contrast" circuit and it works great!
I tried with and without a filter cap and there's no visible difference.
I ended up using 2K and 1K resistors because I had some laying within arms reach and it gives good control.
That's cheaper and uses less real estate than a trimpot, and it gives the user control that I was going to use a digital pot to achieve. With only 2 resistors.
Most Excellent! Thanks Melanie!
steve
Well, I shuffled a bunch of stuff around, made a few circuit changes, and presto!
It all fits on 2-layers now.
5 IC's
19 Capacitors
28 Resistors
5 Transistors
4 Diodes
1 Crystal,
1 LED
+ connectors and wires to the outside world.... power supply, sensors, LCD, etc.
All on a board that's about 2.5" high and less than 2" wide.
Thanks to everyone that provided suggestions and insight. Much appreciated.
steve
![]()
Bookmarks