Hello guys...
It has been a while since my last time here!
Now, most of things have been forgotten but I pretend to get them back.
I'm trying to connect an HD44780 based 20x4 LCD to my AtMega328PU ucontroller and I'm using Peter Fleury's libraries and I can't remember how some of the lcd.h parameters are configured to my LCD module!
I'm talking particularly about this piece of code:
#ifndef LCD_LINES #define LCD_LINES 2 /**< number of visible lines of the display */ #endif #ifndef LCD_DISP_LENGTH #define LCD_DISP_LENGTH 16 /**< visibles characters per line of the display */ #endif #ifndef LCD_LINE_LENGTH #define LCD_LINE_LENGTH 0x40 /**< internal line length of the display */ #endif #ifndef LCD_START_LINE1 #define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */ #endif #ifndef LCD_START_LINE2 #define LCD_START_LINE2 0x40 /**< DDRAM address of first char of line 2 */ #endif #ifndef LCD_START_LINE3 #define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */ #endif #ifndef LCD_START_LINE4 #define LCD_START_LINE4 0x54 /**< DDRAM address of first char of line 4 */ #endif #ifndef LCD_WRAP_LINES #define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */ #endif
I'm not sure how to configure those lines for a 20x4 LCD.
I already tried to look for the addresses in the HD44780 datasheet but I can only find reference to 16x2 LCD addresses as it's stated in this document at page 12.
I hope I provided all information needed!
Edited;
Is it like this:
#ifndef LCD_LINES #define LCD_LINES 4 /**< number of visible lines of the display */ #endif #ifndef LCD_DISP_LENGTH #define LCD_DISP_LENGTH 20 /**< visibles characters per line of the display */ #endif #ifndef LCD_LINE_LENGTH #define LCD_LINE_LENGTH 0x40 /**< internal line length of the display */ #endif #ifndef LCD_START_LINE1 #define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */ #endif #ifndef LCD_START_LINE2 #define LCD_START_LINE2 0x28 /**< DDRAM address of first char of line 2 */ #endif #ifndef LCD_START_LINE3 #define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */ #endif #ifndef LCD_START_LINE4 #define LCD_START_LINE4 0x3C /**< DDRAM address of first char of line 4 */ #endif #ifndef LCD_WRAP_LINES #define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */ #endif
Edit 2;