''verici
@ __config _LP_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF
porta=0:trisa=0
portb=0:trisb=%11000000
include "modedefs.bas"
define OSC 4
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 25 ' 9600 Baud @ 4MHz, 0,16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
cmcon=7
option_reg.7=1 'pinlerin hepsi giris ve cikis olarak ayarlandi
symbol buton=portb.7 'sinyal gonderme
symbol buton2=portb.6 ' uyutma
ver var byte
Ver2 var byte
SYMBOL GIE =INTCON.7 'genel interruptlari açiyor
SYMBOL RCIF =PIR1.5 'USART Receive interrupt flag bit
symbol RCIE= PIE1.5 'usart recive interrupt
CLEAR
GIE=0
RCIF=1
RCIE=1
ver=0
ver2=0
BASLA:
IF buton=1 then
ver=25
gosub GONDER
if buton2=1 then
ver2=35
gosub uyut
endif
endif
goto basla
on interrupt goto GONDER
disable
GONDER:
HSEROUT [REP$AA\5,REP$00\5,REP$FF\5]' UYANDIRMA SINYALIDIR
hSerOUT ["H","T","E",VER]
hSerOUT ["H","T","E",VER]
hSerOUT ["H","T","E",VER]
hSerOUT ["H","T","E",VER]
hSerOUT ["H","T","E",VER]
on interrupt goto uyut
disable
uyut:
HSEROUT [REP$AA\5,REP$00\5,REP$FF\5]
hserout ["R","s","E",ver2]
hserout ["R","s","E",ver2]
hserout ["R","s","E",ver2]
hserout ["R","s","E",ver2]
GIE=1
return
end