Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM --> LCD Contrast

Status
Not open for further replies.

hantto

Member
Hello!

Is it possible to use the PWM output of a PIC to controll the contrast of an LCD? (into pin 3 of lcd)


Thank you!
 

Nigel Goodwin

Super Moderator
Most Helpful Member
hantto said:
Hello!

Is it possible to use the PWM output of a PIC to controll the contrast of an LCD? (into pin 3 of lcd)

Yes, you may need a lowpass filter to generate a stable DC voltage, but it's a commonly used technique (to allow contrast adjustments via the processor).

Personally I've never tried it, I'll be interested to hear how you get on, particularly if you need a filter or not. I'm sure you'll be able to find something about it on the net, maybe even in the MicroChip application notes somewhere?.
 

hantto

Member
Finally I got my LCD to work :þ
Had some problems to get it to work with a 887, so I swiched to 628. Now it works. (yes, your tutorials :) )

Now I will start experimenting with the contrast.
 

hantto

Member
OK my initial tests show that filtering is definately required.

Here are som pics. There is some distortion that doesn't show well on these pictures.
 

Attachments

  • lcd_002.jpg
    lcd_002.jpg
    75.5 KB · Views: 1,988
  • lcd_003.jpg
    lcd_003.jpg
    77.5 KB · Views: 2,017
  • lcd_004.jpg
    lcd_004.jpg
    71.6 KB · Views: 2,056

DigiTan

New Member
That's pretty cool. 8) What was the PWM rate for your contrast signal? And what kind of filtering did you have to apply?
 

hantto

Member
100% is 100% PWM and 0% is 0% PWM, so actually it should say 'PWM' instead of 'Contrast'

I did some experimenting. Used a 330ohm and 10µF as a lowpass filter. It showed some distortion on higher PWMs. After increasing the capacitor to 100µF the distortion dissapeared. So a capacitor between 10µ and 100µ would be optimal.
 

DigiTan

New Member
hantto said:
100% is 100% PWM and 0% is 0% PWM, so actually it should say 'PWM' instead of 'Contrast'

I did some experimenting. Used a 330ohm and 10µF as a lowpass filter. It showed some distortion on higher PWMs. After increasing the capacitor to 100µF the distortion dissapeared. So a capacitor between 10µ and 100µ would be optimal.

Actually, I just meant the wave period in general. Was there any flickering that was noticeble to the naked eye?
 

hantto

Member
Umm... YES! as you can see from the pictures (without the filter that is).

Or am I not still understanding your queston? :)
 
Status
Not open for further replies.

Latest threads

Top