Go Down

Topic: DIP 204-4 4-line-mode (Read 1 time) previous topic - next topic

_frank_

Sep 16, 2011, 11:49 am Last Edit: Sep 16, 2011, 12:35 pm by _frank_ Reason: 1
Hi,

after SPI-Mode does not work, i tryed with 4bit and Liquidcrystal...and i get a text-output...first thank you for the lib ;)

here the Data-Sheet of the display:
http://www.lcd-module.de/eng/pdf/doma/dip204-4e.pdf

the example shows:
"hello, world!" in the first line - OK
"!" in the second line - FALSE (copy of line 1 cols >12 in line 2)
<seconds> in the 3rd line

i changed the row-offsets in LiquidCrystal.cpp see thread - same result

note that only 12 cols are accessable
col 13 [!] and following is printed also on line 2
i looked also in hardware/arduino/cores/arduino/print.cpp for the print-function (but this only uses write in a loop), and its not overwritten in LiquidCrystal.cpp/h

the library only supports 2-line-mode...
i added
#define LCD_4LINE 0x09 to LiquidCrystal.h and the following to the begin-method in the cpp:
 if (lines == 4) {
   _displayfunction = LCD_4BITMODE | LCD_4LINE;
 } else //now the (if lines >1)

now the display changes contrast (white on black,maybe "inverting cursor"), but why?
i cant still not access the 4 lines.. (2= line 3, 1=no text,3=no text)

i assume that the behaviour is because this display uses a "extended function set" to set number of lines, but i dont get it working yet (LCD_4LINE sets reversebit=inverse display)

RE-bit is set by functionset (DB2=4)

regards Frank

_frank_

#1
Sep 16, 2011, 12:59 pm Last Edit: Sep 16, 2011, 02:41 pm by _frank_ Reason: 1
successful enabled 4-line-mode:

LiquidCrystal.h:
// flags for function set
#define LCD_8BITMODE 0x10
#define LCD_4BITMODE 0x00
#define LCD_REBIT 0x04
#define LCD_2LINE 0x08
#define LCD_1LINE 0x00
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00

//extended function set
#define LCD_4LINE 0x09

LiquidCrystal.cpp:

void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
 if (lines == 4) {
   _displayfunction |= LCD_REBIT;
 } else
...
 // finally, set # lines, font size, etc.
 command(LCD_FUNCTIONSET | _displayfunction);  
 if (lines==4)
 {
   command(LCD_4LINE);
   command(LCD_FUNCTIONSET | _displayfunction & !LCD_REBIT );
 }

copy of col>12 persists no more (maybe HD44780 mode only supports 12 cols)
the cols (>=12) are also accessable by setcursor

hoping this will be added to the liquidCrystal lib in further arduino-software-versions
attached my LiquidCrystal.h/cpp based on version 0022
changes are marked by "//FW" appended by a char (a=add,d=delete,c=changed) on every changed line

some special chars are not working yet ($ like x), i try to make a conversion table (maybe charset german <> us) and charset us<>display

to get the $ on my display i have to do the following:
Code: [Select]

 char s[]="hello,world  ";
 s[12]=0xA2;
 lcd.print(s);


some special chars (german display):
Code: [Select]
  lcd.setCursor(0,2);//3rd line, first col
  char s2[20];
  //€ not in charset
  s2[0]=0x5B;//Ä
  s2[1]=0x5C;//Ö
  s2[2]=0x5E;//Ü
  s2[3]=0x7B;//ä
  s2[4]=0x7C;//ö
  s2[5]=0x7E;//ü
  s2[6]=0xBE;//ß
  s2[7]=0xFD;//{
  s2[8]=0xFF;//}
  s2[9]=0xA2;//$
  s2[10]=0x8F;//µ
  s2[11]=0xA0;//@
  s2[12]=0xFA;//[
  s2[13]=0xFC;//]
  s2[14]=0x90;//single note
  s2[15]=0x91;//double note
  s2[16]=0xDE;//arrow up
  s2[17]=0xDF;//arrow right
  s2[18]=0xE0;//arrow down
  s2[19]=0xE1;//arrow left
  s2[20]=0;
  lcd.print(s2);

floresta

Now that you have posted the solution could you provide us with a description of the problem?

Don

_frank_

the display handles not the 4-line-mode of the EA DIP204-4 (maybe other 4-line-displays).

maybe you have to add an "if" at the changed row_offsets (they may not work with other displays, i don't have another to test)

more details are in the first post...but don't use the code provided there

floresta

Quote
the display handles not the 4-line-mode of the EA DIP204-4 (maybe other 4-line-displays).

What do you mean by the 4-line mode?  Are you referring to the the 4 lines of characters on the display or are you referring to the 4 data lines connected to LCD pins 11, 12, 13, and 14?

Don

_frank_

4 lines of characters on the Display...

_frank_

cause my changes are not taken to arduino 1.0, i want to ask why

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy