2
votes

Trying to output a simple string of data "ABCD" using my arduino uno and a LCD you can view in the datasheet link below. My LCD is outputting Japanese characters instead of the string I specify. I've tried several ways in troubleshooting this but haven't yet found a fix. It's clear when you look at the character chart in the datasheet that it's getting the upper bit wrong. Any ideas on what I can try doing.

Here is the link to the data sheet for my LCD.

Here is the code:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12,11,5,4,3,2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print("ABCD");
}

Below is a picture of what it is displaying. Again, it should be printing out ABCD.

Image

1
The character numbers are 193, 194, 195, 204. Not sure about the 204 - should have been 196 ('D' + 128)cup
i've typed in lcd.print((char)193) and it prints out that related character. How do I troubleshoot from here?Shane Yost
i've typed in lcd.print((char)300) and it displays a comma. On the ASCII chart a comma is decimal 44. I guess i'm still not understanding how I need to fix this.Shane Yost
Decimal 300 is nine bits. When that (ignored) top bit is chopped off, you're left with decimal 44.Michael Petrotta
Do you want to print the number 300 or the character A. For A use lcd.print((char) 0x41)cup

1 Answers

0
votes

According to the datasheets and your description of the problem, the left-most bit of the "Upper 4 bits" is always set to one. Thus you should check the wirings (I'm not sure which pin but I would check for instance that DB0 is not always stuck to Vdd)