Page 1 of 1

Controlling LCD contrast from code

Posted: 24 March 2010, 11:45 AM
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

Re: Controlling LCD contrast from code

Posted: 24 March 2010, 11:57 AM
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.

Posted: 24 March 2010, 11:59 AM
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

Posted: 24 March 2010, 12:01 PM
by GTBecker
I've used both a digital pot and PWM.