CFAG12864Q1-TFH Contrast issue

K-Kloster

New member
I am using 4 CFAG12864Q1-TFH displays. The processor I am using is a Arduino Mega 2560. The Library is OliKraus's
U8G2_ST7565_ERC12864_F_4W_HW_SPI u8g2(U8G2_R0, 47, 48, 49).

The Code I am using currently is very basic as I am at this point checking to see if I can get the display to work. At his point, it does.

The problem I am having is that the contrast level seems to be to high as I am getting a rather dark back ground on the entire screen. Currently, I have the contrast level set at "0". This is as low as I can go as the variable is an integer.

Questions:
1): Is the library I am using the correct one??
2): How can I lower the contrast lower??

Ken
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

Jeffrey

New member
Hi Ken,

Thank you for your post. To answer your questions:

1) Is the library correct?
The U8G2 library with the ST7565 ERC12864 constructor will work with the CFAG12864Q1-TFH. However, the display actually uses an ST7567 controller, so you may get better results with a more closely matched constructor.

2) Lowering the contrast below 0
Since you are already at 0 in U8G2 and it is still too dark, we recommend trying our demo code instead, which gives you direct control over the ST7567 contrast registers. In our code, contrast is controlled on line 578:
lcd_cmd_send(31); //Electronic Volume Register Set

The range is 0 (lightest) to 63 (darkest), with 31 as the default. You can also adjust the coarse contrast range by modifying the resistor ratio on line 570:
lcd_cmd_send(0x26); // Range: 0x20 (lightest) to 0x27 (darkest)

You can download our demo code here: https://github.com/crystalfontz/CFAG12864Q1/archive/refs/heads/master.zip

Please let us know if you have any further questions.

Thank you for being a customer of Crystalfontz.

Best regards,
Jeff
 
Top