Write char at a specific address

Hi, I just buy a Mida 20x2 LCD display and only the 8 first characters on each line are displayed.

Regarding the datasheet (http://www.farnell.com/datasheets/1934375.pdf) I would like to write a char at address 0x0A, how can I do that ?

Thanks

Please quote the actual Midas part number or the actual Farnell part number.

All the 20x2 displays should work with the regular hd44780 library (ST7066)
You should see 20 chars per line.

If not initialised, do you see a single line with 8 black boxes or 20 black boxes ?

David.

xtreemechill:
Hi, I just buy a Mida 20x2 LCD display and only the 8 first characters on each line are displayed.

OK, so we need to see the code you are using. Please read the instructions for posting (item 7) to understand how to do this.

xtreemechill:
Regarding the datasheet (http://www.farnell.com/datasheets/1934375.pdf) I would like to write a char at address 0x0A, how can I do that ?

So, this is a completely different and unrelated requirement. What is it that you are proposing to do here?

The farnell part is 2483347.

If not initialized I see 20x2 boxes.

I use the LiquidCrystal Hello world exemple, just change lcd.begin(16,2) to lcd.begin(20,2). I also try with LiquidCrystalFast but it is the same. I use the 4 bits wiring.

I just want to write a char at the address that are referenced on the datasheet like 0x0A.

Your LCD is yellow on black. i.e. it must use a backlight. it is not much good in daylight.

If not initialised, you should see 20x1 boxes.
If initialised, you might see 20x2 boxes. Adjust the contrast to reveal the letters.

Install the hd44780 library.

Get regular text working properly.
Then use lcd.setCursor(9, 0) to draw the next letter at the 10th position on the first line.

If you have a problem:

  1. quote which hd44780 example you are using.
  2. copy-paste the constructor statement.
  3. show a clear photo of your actual wiring between 8x2 header on the display and Arduino headers.

David.

Here are pictures of the screen with high contrast and low, the program is the one below. The wiring is as in the program.

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

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, rw=39, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, rw, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 2);
  // Print a message to the LCD.
  lcd.print("hello, w");
  lcd.setCursor(9, 0);
  lcd.print("orld!");
}

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(millis() / 1000);
}

There are two boxes on the right that are dead I think...

Wait for Bill Perry to wake up. He will know.

It looks as if your display is faulty. Contact Farnell. They will replace it.

David.

Let Bill rest. There is a problem with the display, specifically the auxiliary controllers or the connections to them.

Don

I agree with Don, in that it appears to be an issue with the display.
(Don is the actual expert when it comes to hd44780 chip/chipsets)
What does seems odd to me is that the when the contrast adjustment is way off all the pixels can be driven, but when set properly only the pixels on the left half of the display are begin driven.
I would have thought the zebra connectors might have been an issue but I would think if that was an issue that the righ pixels would always be off.
Maybe Don could speak a bit more as to what might cause this symptom.

In terms of being able to write to specific DDRAM memory locations, it seems like an odd request as normally typically people simply want to set a cursor position on the display and write some text, with little concern about the actual internal memory addresses.
However, if you really want/need to write to specific DDRAM memory addresses, you can use the hd44780 library setCursor(col, row) function.
Just set the row to zero and set the column to the desired memory location.
for example:

lcd.setCursor(memory-address, 0);

Yes the memory-address value can/will be larger than the number of column on the screen, but the library allows this.
This is an intentional capability which is used by the memory testing functions such as the I2CexpDiag diagnostic sketch which needs access to specific memory locations for testing purposes.
When using this, make sure not to enable line wrapping.

--- bill

Thank you all for your help, I just call Farnell, they will send me a new one :slight_smile:

bperrybap:
. . .
What does seems odd to me is that the when the contrast adjustment is way off all the pixels can be driven, but when set properly only the pixels on the left half of the display are begin driven.
I would have thought the zebra connectors might have been an issue but I would think if that was an issue that the righ pixels would always be off.
Maybe Don could speak a bit more as to what might cause this symptom.
. . .
--- bill

I was wondering about that as well. My conclusion was that in any case it is still a hardware issue.

Don