I need to control by a microcontroller the contrast of an alphanumeric LCD.
I have a DAC but I cannot connect it directly, vecouse the DAC output remain low to 0 V.
From my experience with 2 * 16 alphanumeric displays I can tell you that it is only necessary to adjust the contrast once and then leave it there all the time.
I do this by using a 1K pot connected to ground the other end is connected to an 8K2 resistor which is connected to +5V.
The adjustable end of the pot goes to the contrast pin, thats all.
We build this into hundreds of devices without a single problem ...
Use digital potentiometer and operational amplifier connected to negative supply.
Also, second sollution is digitally adjustable switching dc/dc converter.
Maxim makes some good converters.
Thanks to all, but yesterday night I found a good method, cheap and simple that I want to describe for who is interested in:
A single NPN BJT (type BC547) connecte in common collector mode with
a 47 kOhm resistor in base
a 470 Ohm resistor connected to emitter which go to contrast LCD pin
Collector to VCC (5V)
the microcontroller DAC go to the base of BJT bu mean the 47k resistor.
All done.
It function very well.
I use a 680 Ohms series resistor to a 10uF cap connected to GND.
Connect the cap/res junction to LCD and set the DAC output to an acceptable level. I use 2 up/down pb's to adjust the contrast and store into EEPROM. Works fine!