Go Down

Topic: 16x2 serial LCD backlight flickering (Read 4 times) previous topic - next topic

ekaki

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?

digimike

#1
Mar 16, 2010, 12:31 am Last Edit: Mar 16, 2010, 12:32 am by digimike Reason: 1
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.

ekaki

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. -.^

Grumpy_Mike

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.

ekaki

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 -.^

Grumpy_Mike

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.

ekaki

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

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?

Grumpy_Mike


ekaki

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 ^.^

Grumpy_Mike

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

ekaki

#10
Mar 17, 2010, 03:52 pm Last Edit: Mar 17, 2010, 03:54 pm by ekaki Reason: 1
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. :-/

ekaki

#11
Mar 17, 2010, 04:38 pm Last Edit: Mar 17, 2010, 04:48 pm by ekaki Reason: 1
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... :-/

Grumpy_Mike

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.

ekaki

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 -.^

Grumpy_Mike

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.

Go Up