$regfile = "m8515.dat"
'$regfile = "m8def.dat"


Config Lcd = 16 * 2
Config Lcdbus = 4

Config Portd = Output
Portd = 255
'Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portd.5 , E = Portb.1 , Rs = Portb.0
'Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portd.7 , E = Portb.2 , Rs = Portb.1
'Config Lcdpin = Pin , Db7 = Porta.7 , Db6 = Porta.6 , Db5 = Porta.5 , Db4 = Porta.4 , E = Porta.2 , Rs = Porta.1
Config Lcdpin = Pin , Db7 = Portd.7 , Db6 = Portd.6 , Db5 = Portd.5 , Db4 = Portd.4 , E = Portd.2 , Rs = Portd.1

Cls                                                         'pobrisemo zaslon



On Ovf0 Tim0_isr
Config Timer0 = Timer , Prescale = 1
Enable Timer0                                               'omogoči timer
Enable Interrupts                                           'Omogoči prekinitve

Dim Clock12 As Word , P16 As Bit , A12 As Byte

'Config Portb = Output             'dva nacina konfiguriranja
'Config Portb.3 = Output


Do
Portd.3 = P16

Upperline
Lcd "LCD demo"
Lowerline
Lcd "AX elektronika d.o.o."

Wait 1


Cls
Lcd Chr(1)
Wait 1

Deflcdchar 1 , 16 , 8 , 4 , 2 , 1 , 1 , 1 , 1               ' replace ? with number (0-7)


Loop





Tim0_isr:
Incr Clock12
If Clock12 > 31249 Then                                     'za 12 MHz= 46874, za 8 MHz = 31249
   Clock12 = 0
   P16 = Not P16                                            'sekundni impulz
End If

Return