Controlling LCD Contrast with PWM

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guyzz

My first AVR PWM experiment .....

Im experimenting with the 3 PWM timers on a mega8 , and basically it goes pretty well. :P

Analog & RC filters etc , is not my strong side.

Im trying to control the LCD contrast pin on a "Hitachi" compatible Sharp display.

And drives the contrast pin-3 on the LCD via a 1k resistor from OC1B in 8-bit pwm mode with a frequency of 227 Hz.

It basically works fine , and i have a little test where i can see that at around 72/255 dutycycle my characters dissapear.

Someone on the net suggests that : one put 4.7 uf from LCD pin-3 to ground , to smoothen the signal to be more dc like. But if i do that.
I loose the chars at around 38/255 dutycycle. And then have much less granularity to adjust within.

Do i really need a cap going from LCD pin-3 to ground :?:

Next i want to control the Backlight with PWM , and a 2N2222 , but someone said that it should be switching all the time or it would "die" the 2N2222. Well i'll come around to that , and maybe

TIA
Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

See this extensive recent thread. There are others; search them out.

http://2313.avrfreaks.net/phpBB2...

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have read that thread , and its a verry nice thread on stepdown or buckconverting.

I am going to feed my LCD with 5v , so imho the switching circuit is a bit of an overkill.

I was just asking if anyone could give a hint for a 5v circuit (i hope) :)

Can a 2N2222 drive the backlight or should i use a FET ??

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
It basically works fine , and i have a little test where i can see that at around 72/255 dutycycle my characters dissapear.

Someone on the net suggests that : one put 4.7 uf from LCD pin-3 to ground , to smoothen the signal to be more dc like. But if i do that.
I loose the chars at around 38/255 dutycycle. And then have much less granularity to adjust within.

Do i really need a cap going from LCD pin-3 to ground :?:

I would suggest to use the cap. As you don't need the full range from 0 to 255 I would use an additional divider to reduce the voltage. As I understood you need less than 1V for configuring the contrast. What about using a simple voltage divider by 5? Than you get nearly full range. But it will cost some current consumption (because of the resisors) and I don't have a clue in which range you can choose the values of the resistors (depending on the LCD).

Volkmar

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Volkmar :D

Yess you did point me in the right direction ...

I did a voltage divider using the 1k & a 470 ohm (1.6v out) and added a 2.2 uf cap.

Now LCD chars totally dissapear at around 209/255.

I also did try a 4k7 & 1k divider and i might use that one even though i couldnt get the chars to totally dissapear but it seems like there is enough regulation (.88 v out)

What a great forum :)

Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stumbled across this while searching for lcd contrast "tricks"

http://www.elecdesign.com/Articl...

Will this one really generate negative supply ???

Does a LCD (hitachi compatible) display need negative contrast ??
Can it tolerate that ???? , or will it break down ??

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
Stumbled across this while searching for lcd contrast "tricks"

http://www.elecdesign.com/Articl...

Will this one really generate negative supply ???

Does a LCD (hitachi compatible) display need negative contrast ??
Can it tolerate that ???? , or will it break down ??

/Bingo

yes that should generate negative voltage. it's a charge pump. i've used something like that for driving lcd

it depends. some will run with a positive voltage but some require a negative voltage. if your unit displays fine without a negative supply then it doensn't need it and you shouldn't apply negative voltage. consult the datasheet to be sure.