I would print all possible characters, and add a pause after each one (so you have an easier time catching when the problem occurs).
If you have that problem printing an "O", what happens printing a "P" ?
Have a look at the character table, and find out what might be unique to that "O" or look for similarities with other characters you might find to evoke this problem.
Also, check the soldering of the connector, are all pins soldered good ?
If in doubt, redo them.
As floresta states: the loop runs thousands of times per second.
Each time you are resetting the cursor position and sending characters to the display.
Perhaps this might crash your display.
Have a look at the character table, and find out what might be unique to that "O" or look for similarities with other characters you might find to evoke this problem.
Both the upper case O and the lower case o have the lower four bits xxxx1111. They share this pattern with the / ? _ and a back arrow. Is the problem just with the upper case O, or do it's 1111 cohorts have the same problem?
You want all of the code in setup because the information should only be sent to the LCD once.
You do not want any kind of loop for the same reason.
You do not need a delay for the same reason.
You do not have to set the cursor to (0,0) since that is the default position after initialization.
#include <LiquidCrystal.h>
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // put your pin numbers here
void setup()
{
lcd.begin(16, 2); // put your LCD parameters here
lcd.print("hello, world!");
lcd.setCursor(0,1);
lcd.print("it works!");
}
void loop()
{
}
#include <LiquidCrystal.h>
//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // put your pin numbers here
void setup()
{
lcd.begin(20, 4); // put your LCD parameters here
for (char i=47; i<127; i++) // send 80 consecutive displayable characters to the LCD
{
lcd.print(i);
delay(100); // this delay allows you to observe the addressing sequence
}
}
void loop()
{
}
Writing multiple times to the LCD is not a problem and as I said in the previous post, moving the code to setup produces the same error.
Same goes for setting the cursor, you are correct, that code is not needed, but also does not cause the problem (removing the code also produces the same error)
I've checked the Arduino pins with an oscilloscope, they all are working properly.
Could the LCD be damaged? I believe cattledog was on the right track, as per this image, http://www.nunoalves.com/pics/blog/lcd04.png when all four pins are active it is writing "o" or "O".
Try with other characters in the same row: ? _ /, to see if is that. If the problem is that, you must have problems too writing the characters in the last column too.
Did you try to change the pins that are connected to the LCD to other place?
The problem must be too in the bit b1. (H=1000; E=0101; L=1100) Try to write 3, C, S, c, s.