Ich habe mir ein I2C LCD_Modul gekauft(8574), und kann es nicht ansteuern.
Die Angaben zum Modul:
LiquidCrystal_I2C
lcd(0x20,2,1,0,4,5,6,7,3,POSITIVE);//Addr,En,RW,RS,d4,d5,d6,d7,backlighpin,
polarity. Weiterhin steht I2C Adress:0x27.
Ich versuche die Ansteuerung mit einem Atmega 8a und diesem Programm.
Was mache ich falsch?
----------------------------------------------------------------------------
$regfile = "m8adef.dat"
$crystal = 1000000 '1 MHz
$lib "YwRobot_Lcd_i2c.lib"
$hwstack = 64
$swstack = 10
$framesize = 40
'******************* Deklarationen ************************
Const Pcf8574_lcd = &H27 'Adresse des I2C-LCDs
Dim Lcd_backlight As Byte '
'****************** Initialisierung ***********************
Ddrc = &B11111111 'Port B als Ausgangsport
Config Scl = Portc.5 '
Config Sda = Portc.4
Config Lcd = 16 * 2 'nicht unbedingt nötig
Config I2cdelay = 1
Waitms 300 'warte bis Kondensator bei Ta0 geladen, auch für LCD-Init!
'******************** Hauptprogramm ***********************
Cls
Lcd "Hello world!"
Wait 1
Lcd_backlight = 0
Locate 2 , 1
Lcd "2. row..."
Wait 2
Lcd_backlight = 1
Locate 1 , 1 'Damit Backlight-Zustand an LCD übermittelt wird
End
Die Angaben zum Modul:
LiquidCrystal_I2C
lcd(0x20,2,1,0,4,5,6,7,3,POSITIVE);//Addr,En,RW,RS,d4,d5,d6,d7,backlighpin,
polarity. Weiterhin steht I2C Adress:0x27.
Ich versuche die Ansteuerung mit einem Atmega 8a und diesem Programm.
Was mache ich falsch?
----------------------------------------------------------------------------
$regfile = "m8adef.dat"
$crystal = 1000000 '1 MHz
$lib "YwRobot_Lcd_i2c.lib"
$hwstack = 64
$swstack = 10
$framesize = 40
'******************* Deklarationen ************************
Const Pcf8574_lcd = &H27 'Adresse des I2C-LCDs
Dim Lcd_backlight As Byte '
'****************** Initialisierung ***********************
Ddrc = &B11111111 'Port B als Ausgangsport
Config Scl = Portc.5 '
Config Sda = Portc.4
Config Lcd = 16 * 2 'nicht unbedingt nötig
Config I2cdelay = 1
Waitms 300 'warte bis Kondensator bei Ta0 geladen, auch für LCD-Init!
'******************** Hauptprogramm ***********************
Cls
Lcd "Hello world!"
Wait 1
Lcd_backlight = 0
Locate 2 , 1
Lcd "2. row..."
Wait 2
Lcd_backlight = 1
Locate 1 , 1 'Damit Backlight-Zustand an LCD übermittelt wird
End