Go Down

Topic: LCD 128x64 ST7920 using u8glib (Read 26804 times) previous topic - next topic


I can see why the contrast adjustment doesn't work. The Vo pin is not connected on your board because jumper J1 is open (same as on mine), but unlike my board, yours does not have the 10K pot - although the pads have been tinned as though it should have been fitted. Similarly, the Vout pin is not connected - it goes to the resistor at position R12, which is not fitted.

The best suggestion I have is to source a pot of the correct size to fit at VR1, and remove the 0 ohm resistor R6 which is shorting it out. The pot on my board has a resistance of 18K end to end but is set at 2K. So a 10K pot (which is what the ST7920 datasheet shows) would be fine.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Thank you for the help, at least now I know (more or less) why the contrast is not working. The contrast is btw enough ok, also I'll think if it's the case to made these mods. Important is the backlight is working and I don't need other resistors.

Thank's a lot for the support!



I have the same problem of contrast.
My lcd is like Simon's lcd.
There are news?



Hi all,

I am facing an issue with ST7920 LCD. I am not able to display any data on to the LCD. The SYSCLK is 100 MHZ. I am using 8 bit parallel mode operation with the STM32F4xx Discovery board. I have followed the exact initialization given in the Datasheet. Then I am trying to write to the first location that is 0x80 and nothing is being displayed. . Here is my main and initialization function . I am attaching the LCD datasheet. It would be great if anyone can help me.

int Write_DATA(unsigned char string){

        //printf("string = %c\r\n",string);
   GPIOA->BSRRL = (1<<3);//E=H
        Delay(1);//1ms wait
        GPIOD->ODR = string;
   GPIOA->BSRRH = (1<<3);//E=L
        Delay(1);//1ms wait

   return 0;
}//End of Write_Data Function

*   Breif : This function Write the Commad Instruction for the LCD
*   Param : 16 bit command opcaode
*   Retval : None

int Command_WRITE(uint8_t cmd){

        Delay(40); //1000us wait
   //not checking for busy
   GPIOA->BSRRH = (1<<1)|(1<<2);//RS & Rw LW
   GPIOA->BSRRL = (1<<3); // make Enable = H
   Delay(1); //100us wait
        GPIOD->ODR = cmd;//write the data to the bus D0-D7
   GPIOA->BSRRH = (1<<3);//Make Enable = L
   return 0;
}//End of Command_Write Function

int Initialize_LCD(){

   Delay(100); //40ms delay
     ///////////////////reset - B////////////////
   GPIOA->BSRRH = (1<<4); //clear
   Delay(100); //1ms delay
   GPIOA->BSRRL = (1<<4); //PA4 (RESET ) high
     ////////////////FUN SET 1 B////////////////////
   Command_WRITE(0x32);//Function set one selects 8bit
        Delay(1); //150us delay
    /////////////////FUN SET 2 B//////////////////
   Command_WRITE(0x32);//Function set two
   Delay(1); //40us delay
   Command_WRITE(0x0F);//Display on/off
   Delay(1); //150us delay
        Command_WRITE(0x01);//Display clear
   Delay(11); //11ms delay
   Command_WRITE(0x06);//Entry mode set

   return 0;
}//End of LCD Init Function

int main(void){

   Gpio_INIT();  //Initialize the GPIOS connection
        if (SysTick_Config(SystemCoreClock / 1000))
          /* Capture error */
          while (1);

   Initialize_LCD();     //Initalize the LCD
        Write_DATA(' ');
      //  write_init();
       // fill_array();
      //  update_screen();
   return 0;

}//End of main function



Mar 07, 2017, 06:03 pm Last Edit: Mar 07, 2017, 06:06 pm by david_prentice
Surely, life would be easier with SPI mode.
Less pins.   And it is trivial to change the SCK speed.

Of course,  8-bit parallel mode should work too.   It just seems like hard work.

Oh,   and I am not familiar with this library.   Does it really support STM32F4 ?


Edit.   I see that you have put the same question in two places.   This is guaranteed to p*ss people right off.   Please remove one of the messages.


Dear all,
I got a problem:
if I write command as below:
Command 0x30 // RE=1, basic instruction
Command 0x08 // display off, cursor off, blink off
Command 0x34 //
I hold my program right here and the LCD will display the abnormal display, why???

if I write command as below:
Command 0x30 // RE=1, basic instruction
Command 0x08 // display off, cursor off, blink off
Command 0x30 //
The LCD is fine.

Go Up