Pages: [1] 2   Go Down
Author Topic: 16x2 serial LCD backlight flickering  (Read 3512 times)
0 Members and 1 Guest are viewing this topic.
Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi -.^

I'm asking myself if there's a solution to eliminate backlight flickering when adjusting the brightness under full power on a SparkFun serial LCD (16x2)?
This flickering is not very strong, but in some conditions (neon lights for ex.) it's a clearly visible.

If I'm not wrong it's cause the backlight LED is drive by PWM.
So, is someone had trying to place a capacitor somewhere to "smooth" the PWM?

Or the best way is to use another power source, without PWM?
Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a need to adjust the back light brightness? Personally i use a pot not a PWM pin to adjust the brightness of the display but leave the back light on a switch. I think a pot would be a better option for adjusting the back light.
« Last Edit: March 15, 2010, 06:32:24 pm by digimike » Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I find the backlight very powerfull (very well to use by daylight), but in most of case what I'm making will be use by night (power supply for astro-photo applications) so it's a real need (we try to hide a maximum of lighting).
During tests I set the backlight at a very low value (130, BYTE), in regard of possible parameters; it's quite fine, but not too much ^.^

Else, I asked to find a way with the PWM (capacitor?) cause I wouldlike to keep control of brightness by software; it's a good meaning to send visual alerts, by night :o

Anyway, I'll see for a hack of the LCD PCB, and if it's too hazardous (schematic is cheap for the serLCD-v2.. ^.^) I'll do as you say with another circuit to set the backlight. -.^
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't use a capacitor to smooth PWM for an LED as you need the voltage pulses to turn on the LED. If you put a capacitor on you will not have enough voltage to turn on the LED when you want it dim.

The way to stop it flickering is to incr4ase the PWM frequency. Lots of info on that just do a search.
Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Exact Grumpy_Mike, as the voltage is always the same with PWM, if I filtering it, it'll be impossible to change dimming of the LED... -.-

I thought to change the PWM frequency, but as it drive by the PIC on my serial LCD, it may be not easy. I'll see that -.^
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
as the voltage is always the same with PWM, if I filtering it, it'll be impossible to change dimming of the LED

NO, see how PWM works:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Quote
but as it drive by the PIC on my serial LCD,
No the PWM frequency is controlled by the arduino, you just need to alter some values stored in registers.
Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hum, yes, I had to say "voltage is always the same at high level", I spoke about filtering the signal, in our case.
Of course, in PWM, voltage is low or high; not always the same ^.^

Quote
No the PWM frequency is controlled by the arduino, you just need to alter some values stored in registers.
:-?
I did not understood that in the serLCD docs..
Could you tell me the process to alter those values?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did say google it. Never mind I did it for you:-
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1152547089
Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I did say google it. Never mind I did it for you:-
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1152547089
Thank you to help me, but... I'm not sure to understand what you want to tel me.  :-/

In the datasheet of the LCD board I see how changing the duty cycle of the PWM to adjust backlight by sending a cmd to the PIC to change the PWM frequency (0x7C + 128<157). So I think the backlight PWM is driving by the PIC, not by the Arduino (?).  :-?
I imagine I have to send a cmd to the PIC to change the PWM frequency like in your example, but I don't see how.

Sorry for all my questions but I like to know what I do and not just copy some code parts ^.^
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So can you post a link to the data sheet of the device you are using?
Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a SparkFun serial LCD 16x2:
http://www.sparkfun.com/commerce/product_info.php?products_id=9395
with a common HD44780 character LCD:
http://www.sparkfun.com/datasheets/LCD/HD44780.pdf
driven by a PIC16F688 (@10MHz) CMOS µcontroller on board:
http://ww1.microchip.com/downloads/en/DeviceDoc/41203B.pdf
http://www.sparkfun.com/datasheets/LCD/SerLCD-v2-schematic.pdf
http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF

It looks that backlight is driven through the pin #11 of the PIC, with an 1A NPN. But I'v no ideas about how force/change the PWM frequency generated by this PIC. :-/
« Last Edit: March 17, 2010, 09:54:13 am by ekaki » Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Woho... I just understand something..
In:
http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF
We can see:
"By sending the special command character 0x7C followed by a number 128-157, the backlight PWM value will be set."

But in fact, we don't know if it's frequency or duty cycle that will be changed...
In regard of results (flickering) at half values it's possible that the command is on frequency and not on duty cycle (?). I don't have scope to see the signal shape.

Well, it does not solve the problem... :-/
« Last Edit: March 17, 2010, 10:48:47 am by ekaki » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok having looked at the data sheet it looks like you are stuck with the flicker problem unless you want to hack the LCD and control the back light with the arduino's PWM.
Logged

Celtic Kingdom
Offline Offline
Sr. Member
****
Karma: 2
Posts: 455
hard oui no!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, it's why I ask in my first post if the most simply solution will be by using an auxiliary way to control the backlight. A way where I could have fine tune possibilities.

I will see.. Cause I will have to make a complete power system, use a I/O output on the Arduino, etc. It's a bit a pity to get a component like this pretty serLCD but to have to hack it at end.

However, thank you for your help Grumpy_Mike -.^
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's only a matter of connecting the base of that transistor to the arduino. You should be able to lift off the resistor from the base to the PIC and solder a wire on. Then put it through a resistor before you connect it to an arduino PWM.
Logged

Pages: [1] 2   Go Up
Jump to: