Ja natürlich, das regfile muss rein. Hier mein I2C_LCD_Testcode:


Code:
$regfile = "m2560def.dat"
$hwstack = 82                                               '80
$framesize = 68                                             '64
$swstack = 68                                               '44
$crystal = 16000000                                         'Quarzfrequenz
$baud = 9600

$lib "Lcd_i2c.lib"                                          'My I2C driver for the LCD

Config I2cdelay = 1
Const Pcf8574_lcd = 64                                      'Defines the address of the I/O expander for LCD

'Config Portd.0 = Input
'Config Portd.1 = Input

'Portd.0 = 1
'Portd.1 = 1

Config Scl = Portd.0                                        'Configure I2C SCL
Config Sda = Portd.1                                        'Configure I2C SDA

Dim _lcd_e As Byte                                          'Needed to control 4 line LCD
Enable Interrupts

'_lcd_e = 128 select E1, 64 select E2, 192 select both (for CLS or DefLCDChar etc.)
_lcd_e = 128                                                'Upper half of 4-line display is selected




Dim A As Byte
Config Lcd = 20 * 4                                         'configure lcd screen

Start:
Cls                                                         'clear the LCD display
Lcd "1. Zeile"                                              'display this at the top line
Wait 2
Lowerline                                                   'select the lower line
Wait 1
Lcd "2. Zeile"                                              'display this at the lower line
Wait 2

Upperline
Locate 1 , 21                                               'set cursor position    to 3. zeile, 1. Zeichen
Lcd "3. Zeile"                                              'display this
Wait 2                                                      'wait a moment

Lowerline
Locate 2 , 21                                               'set cursor position    to 3. zeile, 1. Zeichen
Lcd "4. Zeile"                                              'display this
Wait 2                                                      'wait a moment


Goto Start

End
mfg

Stefan