LCD blinking too fast?

Hello,

I have this 16x1 LCD : http://www.selectronic.fr/media/pdf/2336-fiche-technique.pdf
I have read these explanations : http://web.alfredstate.edu/weimandn/

My LCD is wired with 4bits length interface.

It works only with the firsts 8 chars ("ABCDEFGH") with this code :

#include <LiquidCrystal.h>
int Contrast=100;
LiquidCrystal lcd(11,10,5,4,3,2);

void setup() 
{
  
  analogWrite(9,Contrast); // yes, the constrast is set with an PWR pin
  lcd.begin(16,1);
  
  // Print a message to the LCD.
  lcd.print("LCD TEST");

   
}

void loop() 
{
  lcd.clear();
  lcd.home();
   lcd.print("ABCDEFGHIJKLMNOP");
   delay(500);
}

I want to be able to write up to 16 chars. This code SEEMS to work :

#include <LiquidCrystal.h>
LiquidCrystal lcd(11,10,5,4,3,2);
void setup() {
  analogWrite(9,80);// yes, the constrast is set with an PWR pin
  lcd.begin(8, 2);
  
   lcd.print("ABCDEFGH");
   lcd.setCursor(0,4);
   lcd.print("IJKLMNOP");
    
   
}

void loop() {}

BUT, the LCD seems to refresh too fast (see this video I did : - YouTube ).

How can I do to have a complete (16 cols) display without this refresh bug?

TL;DR : "lcd.begin(16,1);" displays 8 chars, "lcd.begin(8, 2);" displays all chars but blinking.

Thanks!

BUT, the LCD seems to refresh too fast. . .

BUT - you don't have to refresh the LCD at all. Anything you send to the LCD remains displayed until overwritten or until the power is removed.

The basic problem is that your 16x1 display is internally configured as an 8x2. As you seem to have already discovered, this is explained if you follow the LCD Addressing link at the 'alfred state' link above and scroll down to the section called '16 x 1 LCD (Type 1)'.

The link above describes things in terms of how the LCD controller works, using hex addresses. You have to rework this to use the (column,row) technique of the LiquidCrystal library.

Basically you set the cursor to 0,0 and display the first group of eight characters, reset the cursor to (0,1) and display the second group of eight characters.

This code SEEMS to work :

That's because it is almost correct. The only thing wrong is that you reset your cursor to (0,4), a location that does not exist, and somehow the library interpreted it as (0,1). This error probably caused the blinking.

Don