Hi,
sieht gut aus. Der Test funktioniert auch mit der 2. Zeile korrekt. Ein längerer String wird beim 2 zeiligen Display bis zum 40. Zeichen einfach abgeschnitten. Ab dem 41. Zeichen taucht der restliche String in der 2. Zeile auf.
Folgende Änderungen habe ich an der Lib für das DOGM162 gemacht.
Code:
#define LCD_LINES 2 // Total LCD Lines
#define LRS 6
#define LRW 5
#define LEN 4
void InitLCD(void)
{
SetIOLCD( PORTL & ~LCD_EN ); // Start LCD Control, EN=0
Msleep(1); // Wait LCD Ready
// Initialize LCD
CommandLCD( LCD_8BIT | (LCD_8BIT >> 4) );
CommandLCD( LCD_8BIT | (LCD_4BIT >> 4) );
//==== spezielle Initialisierung fuer DOGM162, 5V===
CommandLCD( 0x29 ); // LCD_4BIT | LCD_2LINE | LCD_5X7| LCD_IS1 ); // Function Set. 4bit Mode, 2 Line LCD, 5x7, Instruction Table 1
CommandLCD( 0x1C ); // LCD_BIAS_1QUARTER // Bias Set 1/4
CommandLCD( 0x52 ); //LCD_BOOSTER_OFF | LCD_CONTRAST_C5 | LCD_CONTRAST_C4 ); // Booster off, Contrast C4, C5
CommandLCD( 0x69 ); //LCD_FOLLOWER_ON | LCD_GAIN_RAB0 ); // Set Voltage follower on and Gain ratio 1
CommandLCD( 0x74 ); //LCD_CONTRAST_C3 | LCD_CONTRAST_C2 | LCD_CONTRAST_C1 ); // Contrast Set C3, C2, C1
//==============================================
CommandLCD( LCD_DISPLAYON ); // Display on/off Control (Entry Display,Cursor off,Cursor not Blink)
CommandLCD( LCD_INCREASE ); // Entry Mode Set (I/D=1 Increment,S=0 Cursor Shift)
CommandLCD( LCD_CLEAR ); // Clear Display
Msleep(2); // Wait Initial Complete
}
Ich habe die Ports des PCF8574 etwas anders belegt.
Die Initialisierungswerte habe ich aus dem Datenblatt als Hex Werte übernommen, Die Defines für die einzelnen Bits stehen in Klammern dahinter. Die Defines kann ich noch nachliefern.
Lesezeichen