DEFINE LCD_DREG PORTB 'LCD DATA BACAKLARI PORTB'YE BAGLI
DEFINE LCD_DBIT 4 'LCD DATA BITLERI HANGİ BITTEN BASLIYOR
DEFINE LCD_EREG PORTB 'LCD ENABLE BACAGI HANGI PORTA BAGLI
DEFINE LCD_EBIT 3 'LCD ENABLE BITI HANGI PORTA BAGLI
DEFINE LCD_RWREG PORTB 'LCD RW BACAGI HANGI PORTA BAGLI
DEFINE LCD_RWBIT 2 'LCD RW BACAGI HANGI BITE BAGLI
DEFINE LCD_RSREG PORTB 'LCD RS BACAGI HANGI PORTA BAGLI
DEFINE LCD_RSBIT 1 'LCD RS BACAGI HANGI BITE BAGLI
DEFINE LCD_BITS 4 'LCD 4 BIT BAGLI
DEFINE LCD_LINES 2 'LCD KAC SIRADAN OLUSUYOR
pause 500
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 25 ' 2400 Baud @ 4MHz, 0,17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
SYMBOL GIE =INTCON.7 'genel interruptları açıyor
SYMBOL PEIE =INTCON.6 'peripheralinterruptları açıyor
SYMBOL RCIE =PIE1.5 'USART Recive interrupt enable bit
SYMBOL RCIF =PIR1.5
symbol SEC=PORTC.5
Pause 500
SEC=0
RCIE=1
PEIE=1
GIE=1
ON INTERRUPT GOTO KESME
trisb.0 = 1
w1 var byte
g1 var byte
g2 var byte
g1=1
g2=2
al var byte
adr var byte
basla:
lcdout $fe,1
lcdout "Mert"
pause 1000
goto basla
end
Gelen1:
lcdout $fe,1
lcdout "gelen1"
pause 1000
goto basla
Gelen2:
lcdout $fe,1
lcdout "gelen2"
pause 1000
goto basla
kesme:
GIE=0
HSERIN 10,ATLA, [WAIT("$ME"),adr,al]
if adr=g1 then goto gelen1
if adr=g2 then goto gelen2
return
ATLA:
GIE=1
Resume
enable
END