NHD-C12865AR-FSW-GBW display is not able to display any data but commands are working
Greetings,
I am using NHD-C12865AR-FSW-GBW display which has ST7565R controller. I am trying to display few characters on screen but display is not working. I am using 1uF capacitor with C1, C2 and C3 pins as per display datasheet and I am using 0.1uF capacitors with V1-V5 pins.
Commands are working and Display ON(0xAF) command turns ON all pixels on display but I am not able to display data.
I am using STm32l0 series processor and serial communication protocol. I have pulled up D0-D5 pin, /RD, C86 and /WR pins( Also tried floating pin configuration).
#define LCDWIDTH 128
#define LCDHEIGHT 65
#define CMD_DISPLAY_OFF 0xAE
#define CMD_DISPLAY_ON 0xAF
#define CMD_SET_DISP_START_LINE 0x40
#define CMD_SET_PAGE 0xB0
#define CMD_SET_COLUMN_UPPER 0x10
#define CMD_SET_COLUMN_LOWER 0x00
#define CMD_SET_ADC_NORMAL 0xA0
#define CMD_SET_ADC_REVERSE 0xA1
#define CMD_SET_DISP_NORMAL 0xA6
#define CMD_SET_DISP_REVERSE 0xA7
#define CMD_SET_ALLPTS_NORMAL 0xA4
#define CMD_SET_ALLPTS_ON 0xA5
#define CMD_SET_BIAS_9 0xA2
#define CMD_SET_BIAS_7 0xA3
#define CMD_RMW 0xE0
#define CMD_RMW_CLEAR 0xEE
#define CMD_INTERNAL_RESET 0xE2
#define CMD_SET_COM_NORMAL 0xC0
#define CMD_SET_COM_REVERSE 0xC8
#define CMD_SET_POWER_CONTROL 0x28
#define CMD_SET_RESISTOR_RATIO 0x23 // edited to set resistor ratio = 4... pr. v was 0x23
#define CMD_SET_VOLUME_FIRST 0x81
#define CMD_SET_VOLUME_SECOND 0
#define CMD_SET_STATIC_OFF 0xAC
#define CMD_SET_STATIC_ON 0xAD
#define CMD_SET_STATIC_REG 0x0
#define CMD_SET_BOOSTER_FIRST 0xF8
#define CMD_SET_BOOSTER_234 0
#define CMD_SET_BOOSTER_5 1
#define CMD_SET_BOOSTER_6 3
#define CMD_NOP 0xE3
#define CMD_TEST 0xF0
void Display_Init(void) {
Display_Write_cmd(CMD_INTERNAL_RESET); // system reset
Display_Write_cmd(CMD_SET_DISP_START_LINE); // set LCD start line to zero line :)
// ADC select
Display_Write_cmd(CMD_SET_ADC_NORMAL);
// LCD bias select
Display_Write_cmd(CMD_SET_BIAS_9); // as bias is 1/9
// SHL select
Display_Write_cmd(CMD_SET_COM_NORMAL);
// Initial display line
// Display_Write_cmd(CMD_SET_DISP_START_LINE);
// turn on voltage converter (VC=1, VR=0, VF=0)
Display_Write_cmd(CMD_SET_POWER_CONTROL | 0x4); // setting voltage boost on (0X2C)
// wait for 50% rising
HAL_Delay(50);
// turn on voltage regulator (VC=1, VR=1, VF=0)
Display_Write_cmd(CMD_SET_POWER_CONTROL | 0x6);// setting voltage boost on (0X2E)
// wait >=50ms
HAL_Delay(50);
// turn on voltage follower (VC=1, VR=1, VF=1)
Display_Write_cmd(CMD_SET_POWER_CONTROL | 0x7); // voltage follower ON (0X2F)
// wait
HAL_Delay(10);
Display_Write_cmd(CMD_SET_BOOSTER_FIRST); // set booster ratio
Display_Write_cmd(CMD_SET_BOOSTER_234); // set booster
// set lcd operating voltage (regulator resistor, ref voltage resistor)
Display_Write_cmd(CMD_SET_RESISTOR_RATIO | 0x6);
Display_Write_cmd(0x64); // contrast = 40%
Display_Write_cmd(CMD_SET_STATIC_OFF); // static indicator OFf
Display_Write_cmd(0x00); //
//Display_Write_cmd(CMD_DISPLAY_ON); // enable display
HAL_Delay(100);
// Display_Write_cmd(CMD_SET_ALLPTS_ON); // set all points
HAL_Delay(100);
Display_Write_cmd(CMD_SET_ALLPTS_NORMAL); // set all points
HAL_Delay(100);
Display_Write_cmd(CMD_SET_VOLUME_FIRST);
Display_Write_cmd(CMD_SET_VOLUME_SECOND | (70 & 0x3f));
}
/* Write command to display */
void Display_Write_cmd(unsigned char cmd) {
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_RESET); // AO pin low for command
HAL_SPI_Transmit(&hspi1, &cmd, 1, HAL_MAX_DELAY);
}
/* Write data to display */
void Display_Write_Data(unsigned char* data, uint16_t size) {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, 0);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6, GPIO_PIN_SET); // AO pin high for data
HAL_SPI_Transmit(&hspi1, &data, size, HAL_MAX_DELAY);
}
-
Hi,
Thank you for waiting on us. Could you please confirm that you are providing the correct power to the display?
Your command and data functions have different parameters types.
void Display_Write_cmd(unsigned char cmd)
void Display_Write_Data(unsigned char* data, uint16_t size)For your data function could you try the following instead:
void Display_Write_Data(unsigned char data, uint16_t size)
1 -
Thank you so much for your response.
Okay, I will try as per your suggestion. yes, I am providing 3.3V to display and receiving 10-11V at Vout.
what is ideal voltage at Vout?
My initialization command sends below mentioned values:
0xE2 for internal reset
0xA0 for ADC normal operation
0xA2 to set bias 1/9
0xC0
0x2C for power control
0x2E for power control
0x2F
0x2F for booster
0x00 for booster
0x77 for resistor ratio
0x64 for contrast
0xAC for static OFF
0xAF to turn display ON
0xA5 to make all points On
EDIT: I was trying to change my initialization code but now I found out that I am not getting 10-11V at Vout but only 2.5V. Does that mean ST7565 is damaged? or I configured ST7565 wrong?
0 -
Hi,
The Vout is determine with a combination of the software and the booster circuit. I wonder if the change in the parameters in the data function caused this voltage change. Could you please revert back your code to what you originally had and measure Vout again? The Vout pin is the supply for the LCD contrast since you are measuring 10-11V it means that the contrast is high and might be difficult to see if any graphics are being displayed. The typical contrast would be 9.5V.
1 -
Thank you so much for your response.
Okay. I will plan according to your suggestion.
0
Please sign in to leave a comment.
Comments
4 comments