Liquid Crystal Display

I have an LCD 2004 connected with an Arduino UNO and is working almost in the way it should, but when I change some of the text written in the sketch it writes rubbish.

In this case, it is working properly:
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" TIME CONTROL");
lcd.setCursor(0,1);
lcd.print("Current:");
lcd.setCursor(0,2);
lcd.print("Start :");
lcd.setCursor(0,3);
lcd.print("Elapse :");

In case that I make just small change, it is writing rubbish in the 3th and 4th lines:
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" ...TIME CONTROL..."); <-------- small change
lcd.setCursor(0,1);
lcd.print("Current:");
lcd.setCursor(0,2);
lcd.print("Start :");
lcd.setCursor(0,3);
lcd.print("Elapse :");

please somebody has an idea to solve the problem?

jorge-arduino:
. . .
please somebody has an idea to solve the problem?

Not without seeing the entire program.

Don

Dear Floresta:

Here you have the sketch, I am just starting with the application but this small starting part does not work properly, it would be nice if you have an idea to solve it.

Thanks

Jorge

#include <LiquidCrystal.h>
int VO = 3;
int RS = 4;
int E = 5;
int D4 = 6;
int D5 = 7;
int D6 = 8;
int D7 = 9;
LiquidCrystal lcd (RS,E,D4,D5,D6,D7);

void setup(){
analogWrite(VO,50);
lcd.begin(20,4);
lcd.setCursor(0,0);
lcd.print(" TIME CONTROL ");
lcd.setCursor(0,1);
lcd.print("Current:");
lcd.setCursor(0,2);
lcd.print("Start :");
lcd.setCursor(0,3);
lcd.print("Elapse :");
}

void loop() {
}

You have to be more specific when it comes to the term 'rubbish'.

It looks like you may be using PWM for the contrast voltage - why?

Don

floresta:
It looks like you may be using PWM for the contrast voltage - why?

Reading some inane "instructable" nonsense most likely. :astonished:

If you don't have a 330 Ohm resistor, just connect pin 3 of the LCD directly to ground.

Nevertheless, this silly mistake should only cause an indistinct or flickering display, not garbling of individual characters.

Need to read the instructions regarding how to post code.

floresta:
You have to be more specific when it comes to the term 'rubbish'.

It looks like you may be using PWM for the contrast voltage - why?

Don

[Yes, I am using the PWM to avoid a potentiometer for the contrast voltage, perhaps is the noise introduced because of the PWM, to try I put the VO pin to earth and now it is working OK, should I put a filter in the VO input to work with the PWM?

Thanks /quote]

. . . should I put a filter in the VO input to work with the PWM?

No. You should do what Paul recommended in reply #4.

Don

It would be nice to see some photos of the display, so we can get a look at the "rubbish".

Thanks a lot.