LCD Contrast control

General discussion on mikroBasic.
Post Reply
Author
Message
gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

LCD Contrast control

#1 Post by gambrose » 20 Jan 2005 20:27

I wanted to use the PWM module to control the contrast of a LCD display but having tested it out it doesn’t really work as I expected.
I’m not really very good with electronics but I think it might be that the contrast is usually connected to earth or something.
Anyway any advice would be appreciated.

SBA
Posts: 73
Joined: 10 Jan 2005 23:16
Location: Virginia

#2 Post by SBA » 20 Jan 2005 21:48

to Pic R
<------------------/\/\/\/\------------|------->analog out
|
|
------ +
uF Aout=(Duty/255)*5v
------ ChargeTime=4*R*C
|
|
Ground

does your output from the pic resemble this?
Included The formulas to calc vout and Charge times

SBA
Posts: 73
Joined: 10 Jan 2005 23:16
Location: Virginia

#3 Post by SBA » 20 Jan 2005 21:50

Grrr, sorry it left shifted the lines, hope you can make sense of it

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#4 Post by gambrose » 20 Jan 2005 21:56

Don’t think so I just connected the contrast pin of the LCD to the PWM pin of the pick.

I was hoping this would work.

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#5 Post by gambrose » 20 Jan 2005 21:57

you sould post your little ascii picture using code tags as these keep the white space.

SBA
Posts: 73
Joined: 10 Jan 2005 23:16
Location: Virginia

#6 Post by SBA » 20 Jan 2005 21:58

I think the LCD display is looking for an analog voltage on the pin. So the pwm out straight from the pic would be digital, and this may confuse the display.

SBA
Posts: 73
Joined: 10 Jan 2005 23:16
Location: Virginia

#7 Post by SBA » 20 Jan 2005 21:59

gambrose wrote:you sould post your little ascii picture using code tags as these keep the white space.
hehe thought about that after i hit the send.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#8 Post by LGR » 20 Jan 2005 22:01

There was a thread on GLCDs which touched on this topic. There are two basic types floating around, standard temperature and high temperature. Standard uses a bias level between 0 and 5 volts. Extended typically runs between -5 and +5 volts, and can even run lower. The character displays are typically standard, thought there are a few extended in existance. The GLCDs can be either. Some ET GLCDs have built-in DC-DC converters, and furnish -5V to use with this.

The first thing that you need to do is determine what you have. For a manual pot, look at the mB manual; there is a diagram. For standard temp, one side connects to +5, the other to Gnd, and the wiper to the LCD. I would verify operating this way first.

IF you have standard, PWM should be able to produce the right voltage, but I don't know about the current. Also, an RC network is necessary with PWM.

If you have ET, there is an op-amp circuit which will produce -5 to +5 V out as the input goes from 0 to +5V. Of course, you will need a -5 supply, and the PWM output needs an RC filter.

If you want the diagram for the circuit, I will describe it: You need a rail-to-rail op amp. High rail to +5, low rail to -5. Two resistors of equal value (maybe 100K), in series between +5 and op amp output. + input to PWM (RC net), - input to the node between the two resistors. As the + input goes from 0 to +5, the output will go from -5 to +5.

SBA
Posts: 73
Joined: 10 Jan 2005 23:16
Location: Virginia

#9 Post by SBA » 20 Jan 2005 22:02

Code: Select all



                                         R
pic<------------------------/\/\/\/\----------|------------> Analog Out
                                                           |
                                                           |
                                                        ------ +
                                                                   uF
                                                        ------
                                                            |
                                                            |
                                                           \/ Ground

Hope that is better :oops:

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#10 Post by gambrose » 20 Jan 2005 22:16

Thanks Tech I was trying out your circuit but I accidentally plugged the LCD shifted left by one plug and it got very hot and broke :cry:

But I will try again with another LCD

Post Reply

Return to “mikroBasic General”