I am testing a 16x2 LCD screen specifically the 'MCCOG21605B6W-FPTLWI' from 'MIDAS'. It is connected to the with the 'msp430g2553 launchpad'. The connections are described in the commented code fragment that I have attached in this message. The backlight adjusts it through the working cycle of the PWN which connects it to the anode (this works correctly). The character are written correctly on the LCD but the problem is the contrast, it is very very low. To see the characters I have to turn the LCD and at some angle you can see that there is written text. As is an LCD by i2c, the contrast adjustment is done by commands, not by any potentiometer. As you can see in the code, I initialize the LCD as indicated by the datasheet for a 3V power supply:
/*
MSP4302553| |LCDDriver
|Pin 1 Boost Capacitor 1
|Pin 2 Capacitor 2 N
|Pin 3 Capacitor 2 P
Vcc (3.5V) |---------|Pin 4 Vdd (Boost Capacitor 1)
Gnd |---------|Pin 5 Gnd
P1.7|---------|Pin 6 (SDA)
P1.6|---------|Pin 7 (SCL)
P2.5|---------|Pin 8 (RST)
P2.4|---------| A (Backlight Anode)
Gnd |---------| K (Backlight Cathode)
*/
.
.
.
char TxData[] = // Table of LCD display initialization commands
{ 0x00,
0x38,
0x00,
0x39,
0x14,
0x74, //Contrast set
0x54,
0x6F, //Follower control
0x0C, //Display On, Cursor On, Cursor Blink On
0x01
};
. . .
The initialization of the LCD is the one proposed by the manufacturer for 3V power supply:
INITIALIZE: (3V)
MOV I2C_CONTROL,#00H ;WRITE COMMAND
MOV I2C_DATA,#38H ;Function Set
LCALL WRITE_CODE
MOV I2C_CONTROL,#00H ;WRITE COMMAND
MOV I2C_DATA,#39H ;Function Set
LCALL WRITE_CODE
MOV I2C_DATA,#14H ;Internal OSC frequency
LCALL WRITE_CODE
MOV I2C_DATA,#74H ;Contrast set
LCALL WRITE_CODE
MOV I2C_DATA,#54H ;Power/ICON control/Contrast set
LCALL WRITE_CODE
MOV I2C_DATA,#6FH ;Follower control
LCALL WRITE_CODE
MOV I2C_DATA,#0CH ;Display ON/OFF
LCALL WRITE_CODE
MOV I2C_DATA,#01H ;Clear Display
LCALL WRITE_CODE
I have tested with various values of the commands that can cause the characters not to be seen: 'Display ON / OFF', 'Follow Control' and 'contrast set' but without any result. It always looks with contrast practically 0. Do you know why the initial configuration proposed by the manufacturer does not work?
This is the datasheet: MIDAS LCD 16X2 Datasheet