@ DEVICE pic16F628A, INTRC_OSC_NOCLKOUT
TRISA=%00000001
TRISB=%00000001
CMCON=7 '16F628a de komparatör pinleri iptal hepsi giris çıkıs
'------------------------------TANIMLAMALAR------------------
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_RWREG PORTB
DEFINE LCD_RWBIT 2
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
PORTA=0
PORTB=0
PAUSE 200
LCDOUT $FE,1
'-------------------------------DEGISKENLER--------------------
SAYAC VAR WORD
RX1 VAR WORD
RX2 VAR WORD
RX3 VAR WORD
RX4 VAR WORD
RX5 VAR WORD
RX6 VAR WORD
RX7 VAR WORD
RX8 VAR WORD
RX9 VAR WORD
RX10 VAR WORD
RX11 VAR WORD
RX12 VAR WORD
RX13 var word
'--------------------------------BASLANGIC---------------------
READ 0,SAYAC
IF SAYAC=255 THEN
SAYAC=0
WRITE 0,SAYAC
ELSE
ENDIF
LCDOUT $FE,1,"SISTEM BASLIYOR!"
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=1",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=2",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=3",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=4",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=5",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=6",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=7",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=8",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=9",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=10",13]
pause 1000
LCDOUT $FE,1,#SAYAC
'--------------------------------ANA PROGRAM-------------------
BASLA:
SerIn PORTA.0,0,500,SAY,["+CMT"],RX4
PAUSE 1000
LCDOUT $FE,1,#SAYAC
LCDOUT $FE,$C0,"SORGULAMA"
IF RX4="I" THEN
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGR=1",13]
SerIn PORTA.0,0,1000,SAY,["+08"],RX5,RX6,RX7,RX8
PAUSE 1000
IF RX8="1" THEN
LCDOUT $FE,1,#SAYAC
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGS=+905368698018",13]
pause 1000
SEROUT PORTA.1,0,[#sayac,$1A]
pause 2000
SEROUT PORTA.1,0,[$1A]
pause 1000
ENDIF
IF RX8="2" THEN
LCDOUT $FE,1,#SAYAC
PORTA.2=1
ENDIF
IF RX8="3" THEN
LCDOUT $FE,1,#SAYAC
PORTA.2=0
ENDIF
ENDIF
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT",13]
pause 1000
SEROUT PORTA.1,0,["AT+CMGD=1",13]
GOTO SAY
SAY:
LCDOUT $FE,1,#SAYAC
IF PORTB.0=1 THEN
SAYAC=SAYAC+1
WRITE 0,SAYAC
PAUSE 200
LCDOUT $FE,1,#SAYAC"
PORTB.0=0
ENDIF
GOTO basla