Graphic ST7565 Negative LCD (128x64) contrast help

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ageppert
 
Posts: 3
Joined: Mon Jan 28, 2013 7:30 pm

Graphic ST7565 Negative LCD (128x64) contrast help

Post by ageppert »

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?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

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
ageppert
 
Posts: 3
Joined: Mon Jan 28, 2013 7:30 pm

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

Post by ageppert »

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.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

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

Post by adafruit_support_bill »

Sounds like you have a bad red led in the backlight. Contact [email protected] with a link to this thread and ask for a replacement display.

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

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

Post by ageppert »

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

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

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

Post by adafruit »

LCDs like these are inherently low-contrast. OLEDs and LEDs and TFTs tend to have higher contrast.

User avatar
Janala
 
Posts: 1
Joined: Fri May 02, 2014 10:46 am

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

Post by Janala »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”