Can you get rid off of the U4 and replace the function with some PWM from the PIC itself?
Ioannis
Can you get rid off of the U4 and replace the function with some PWM from the PIC itself?
Ioannis
Mmmmm.... I don't know. The contrast pin for the LCD wants to be on the "wiper" of a 10K pot with the other legs connected to Vdd and Vss.
I'm not sure what would happen if I fed it from a filtered PWM output... ?
U4 actually eats up about the same amount of real estate as the 10K pot that it replaced on my original design, but it adds easy user adjustment.
Actually, I've been working on it some today and I'm starting to think I just might get the whole thing on 2 layer now that I've got a bit better layout.
We'll see....
steve
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
Bookmarks