'------------------------------------------------------------ ''------------------------------------------------------------ $regfile = "8515def.dat" $baud = 9600 $crystal = 6144000 Dim Zahl As Byte 'setup to use a serial output buffer 'and reserve 20 bytes for the buffer Config Serialout = Buffered , Size = 20 ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 'GND +5V DI RS RW E Databyte-> Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Porta.7 , Rs = Porta.5 'These settings are for the AVR-Ctrl in PIN mode Config Lcd = 16 * 2 'configure lcd screen 'other options are 16 * 4 and 20 * 4, 20 * 2 , 16 * 1a 'When you dont include this option 16 * 2 is assumed '16 * 1a is intended for 16 character displays with split addresses over 2 lines Config Portc = Output 'configure portc as output Config Porta = Output 'configure portc as output Reset Porta.6 'write mode for display Reset Portc.0 Reset Portc.1 Reset Portc.2 Reset Portc.3 Initlcd 'init display again 'You need this lines, because RD is connected to PORTC.1 'These lines are only for the AVR-Ctrl Cursor On Cls 'clear the LCD display Lcd "Hello world!" 'display this at the top line Zahl = 0 'It is important since UDRE interrupt is used that you enable the interrupts Enable Interrupts Print "Hello world" Do Wait 1 'notice that using the UDRE interrupt will slown down execution of waiting loops like waitms Print "Test Nr.:" Print Zahl Zahl = Zahl + 1 Loop End End