Moin,
hab mir das nochmal angesehen, insbesondere eins der HD44780 Datasheets.
Entweder hab ich etwas nicht kapiert, von wegen Cursor left/right und
Display left/right, oder die haben sich bei der xlcd.h geirrt...mal ein
kleiner Auszug von den Definitions in xlcd.h:
1 | /* Cursor or Display Shift defines */
|
2 | #define SHIFT_CUR_LEFT 0b00000100 /* Cursor shifts to the left */
|
3 | #define SHIFT_CUR_RIGHT 0b00000101 /* Cursor shifts to the right */
|
4 | #define SHIFT_DISP_LEFT 0b00000110 /* Display shifts to the left */
|
5 | #define SHIFT_DISP_RIGHT 0b00000111 /* Display shifts to the right */
|
Wenn ich mir nun das HD44780 Datasheet ansehe:
Entry
mode set 0 0 0 0 0 0 0 1 I/D S Sets cursor move direction
and specifies display shift.
I/D: Increment = 1, Decrement =0
S = 1 :Accompanies display shift
Cursor or
display
shift 0 0 0 0 0 1 S/C R/L — — Moves cursor and shifts
display without changing
DDRAM contents.
S/C: Display Shift = 1; Cursor Move= 0
R/L: to the right = 1; to the left= 0
dann denk ich sollte das bei xlcd.h eher so aussehen:1 | /* Entry mode set */
|
2 | #define CUR_RIGHT_NO_DISP_SHIFT 0b00000110 /* Cursor move right, no shift of the display */
|
3 | #define CUR_LEFT_NO_DISP_SHIFT 0b00000100 /* Cursor move left, no shift of the display */
|
4 | #define CUR_RIGHT_DISP_SHIFT 0b00000111 /* Cursor move right, shift of the display */
|
5 | #define CUR_LEFT_DISP_SHIFT 0b00000101 /* Cursor move left, shift of the display */
|
6 | /* Cursor or Display Shift defines */
|
7 | #define SHIFT_CUR_LEFT 0b00010000 /* Cursor shifts to the left */
|
8 | #define SHIFT_CUR_RIGHT 0b00010100 /* Cursor shifts to the right */
|
9 | #define SHIFT_DISP_LEFT 0b00011000 /* Display shifts to the left */
|
10 | #define SHIFT_DISP_RIGHT 0b00011100 /* Display shifts to the right */
|
Benutze ich aus der xlcd.h die Definition SHIFT_DISP_LEFT in OpenXLCD.c
dann ist die Darstellung auf meinem 2x16 HD44780 perfekt, also wenn ich
im Grunde den Entry Mode: Cursor move right, no shift of the display
nehme.
Gruß
Beast