Controlling LCD contrast from code

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Controlling LCD contrast from code

Post by FFMan »

Whats the best/proven way to control LCD contrast from within code. The lcd modules have a contrast pin which takes a voltage between 0 and 5v, though typically its virutally grounded.

In my project its not that practical to have an exposed pot.

thanks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Controlling LCD contrast from code

Post by dkinzer »

FFMan wrote:Whats the best/proven way to control LCD contrast from within code.
Given that you need a variable voltage, the solutions that come to mind are a digital-to-analog converter and a digital potentiometer. In the latter category, you should be able to find a wide range of choices with various resolutions and interfaces (e.g. SPI, I2C, up/down, etc.). Maxim, Analog Devices and others make digital potentiometers.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Maxim has an application note on the topic of using a digital pot for LCD contrast control:
http://pdfserv.maxim-ic.com/en/an/AN1176.pdf
- Don Kinzer
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

I've used both a digital pot and PWM.
Tom
Post Reply