Graphic ST7565 Negative LCD (128x64) contrast help
Moderators: adafruit_support_bill, adafruit

Graphic ST7565 Negative LCD (128x64) contrast help

by ageppert on Mon Jan 28, 2013 7:39 pm

Greetings! I recently purchased and got this display up and running:

https://www.adafruit.com/products/438

Two questions are embedded below and denoted (1), and (2):

I have the display connected to an Arduino Uno, using the level shiftter provided to get to 3.3V. All is well there, and the 3.3V is also driving the Blue backlight LED. The demo code runs fine!

I am struggling with the contrast setting. As it runs now, (Adafruit library being used with Arduino IDE), the contrast is set to 0x18, and I can follow the code to see that that value is pushed to the 7565 controller in the ST765.cpp as shown here:

void ST7565::st7565_set_brightness(uint8_t val) {
st7565_command(CMD_SET_VOLUME_FIRST);
st7565_command(CMD_SET_VOLUME_SECOND | (val & 0x3f));
}

I have tried 0 to 255 as the "brightness" (actually... contrast from what I read) and I just can't get an improvement. The display content is their, but the best I can get is a dim view of it with the default 0x18. (1) Why am I not able to land a better contrast as I run through all of the possibilities? From reading the datasheet for the controller, the value is selectable between 0 and 63, so my numbers definitely take me through and beyond that range.

But the value I'm sending is AND'd with 0x3f before it is written to the register. (2) Why is that? Can I remove the & 0x3f and just use a "val" between 0 and 63?

Thanks in advance for your help.

Andy

EDIT:
I should also mention that I tried using 3.3V from a bench supply to drive the LED backlight just to make sure the 3.2V the Arduino was supplying was sufficient. It appears sufficient in both cases. However, the red LED barely turns on, but the blue and green seem to work OK. Overall, I'm wondering if this is a backlight problem because the display just isn't nearly as bright as it appears in other peoples videos and pictures. The outer border should be fairly bright regardless of the contrast setting in the main area of the display, shouldn't it?
ageppert
 
Posts: 3
Joined: Mon Jan 28, 2013 7:30 pm

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by adafruit_support_bill on Tue Jan 29, 2013 6:57 am

Hexadecimal Ox3F is decimal 63, so masking with that value simply strips off any higher order bits.

Typically the red led tends to be the strongest of the three. How do you have the backlight connected? Is it connected directly or via a series resistor?
User avatar
adafruit_support_bill
 
Posts: 32596
Joined: Sat Feb 07, 2009 10:11 am

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by ageppert on Tue Jan 29, 2013 6:09 pm

Ah so. As I thought about it, I could see what is going on with that masking. Thanks for clarifying that.

Backlight LEDs are currently connected directly to the 3.3V of the Uno. I also tried them connected to 5V through a 240 ohm resistor and the result was similar.
ageppert
 
Posts: 3
Joined: Mon Jan 28, 2013 7:30 pm

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by adafruit_support_bill on Wed Jan 30, 2013 6:51 am

Sounds like you have a bad red led in the backlight. Contact support@adafruit.com with a link to this thread and ask for a replacement display.
User avatar
adafruit_support_bill
 
Posts: 32596
Joined: Sat Feb 07, 2009 10:11 am

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by ageppert on Tue Feb 19, 2013 12:26 pm

I received the replacement display and I am still struggling to get adequate brightness and contrast out of it. All of the LEDs work, and I'm using all three at 3.3V.

I have tried the full range of contrast values, and can't seem to improve on the default which is 24.

I have experimented with a range RESISTOR_RATIOs from 0 to 7. The default 6 seems to be the best.

When you created the library and tested it with this display, did you have to experiment with any other parameters to get it working properly? Maybe my expectations with respect to brightness are just too high. I was expecting to see the display clearly across a well lit office room, but it is extremely dim. If I am up close, I can see the falling fruits in the last part of the demo, but the splash screen is extremely dim, and I have yet to see the line drawing part of the demo.

Thank you again for you assistance.

Andy
ageppert
 
Posts: 3
Joined: Mon Jan 28, 2013 7:30 pm

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by adafruit on Wed Feb 20, 2013 1:01 pm

LCDs like these are inherently low-contrast. OLEDs and LEDs and TFTs tend to have higher contrast.
User avatar
adafruit
 
Posts: 11778
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Graphic ST7565 Negative LCD (128x64) contrast help

by CDragon on Fri May 02, 2014 11:00 am

I found I could barely see anything on this display as well, especially without the backlight, until I changed glcd.begin(0x18) to glcd.begin(0x26) which sets the contrast higher. I read a post elsewhere in this forum that said the default 0x18 was best for them, so apparently each display may be calibrated differently. I know you said you tried all the contrast values and 0x18 was best, but are you sure the setting was actually working (contrast was actually changing), and did you try higher values? It can go up to 0x3F, I think, at which point the screen should mostly turn entirely white.

With the correct contrast, the screen should be visible under normal room lighting even at night without the backlight on. The backlight can help with visibility and its brightness (and color, to some extent) varies with voltage. The tutorial says to put a ~100ohm resistor on the LCD backlight. I only had a 75ohm available which brings the voltage to 2.5 and the backlight is acceptably bright. I also tried connecting to 3.3V without a resistor and the backlight was much brighter. I wish the tutorial explained why you need to put in a resistor though - I'm guessing 3.3V might strain the backlights and cause early failure?

If you're sure contrast setting was working and backlight voltage was high enough, then maybe you got two bad boards in a row. When calibrated correctly, each part of the demo sketch, including the lines, screen should be easily visible with or without backlight even in average artificial room light.
CDragon
 
Posts: 1
Joined: Fri May 02, 2014 10:46 am



cron