Device = 16F877A
Xtal = 4
All_Digital true
Hserial_Baud = 9600 ' Seri iletişim hızı 9600 bPs
Hserial_RCSTA = %10010000 ' seriport açık ve alıma herzaman açık
Hserial_Clear = On ' bilgi alındığında Tampon belleği temizle
LCD_DTPin = PORTD.4
LCD_RSPin = PORTE.0
LCD_ENPin = PORTE.1
LCD_Interface = 4 ' 4-bit Interface
LCD_Lines = 2
LCD_Type = 0
LCD_CommandUs = 2000
LCD_DataUs = 50
Symbol PEIE = INTCON.6 ' Peripheral Interrupt Enable
Symbol GIE = INTCON.7 ' Global Interrupt Enable
Symbol RCIE = PIE1.5 ' USART Receive Interrupt yetki
Symbol RCIF = PIR1.5 ' USART Receive Interrupt bayrağı
GIE=0 'tüm kesmeler kapalı
PEIE=1 'Çevre birim kesmesi aktif
RCIE=1 'Usart alım kesmesi aktif
GIE=1 'tüm kesmeler aktif
Dim satir As Byte 'satir adında byte değişken
Dim Dongu As Byte 'donu adında byte değişken
Dim GelenBilgi As Byte
satir=1
On Interrupt GoTo kesme 'software kesmesi
basla: 'ana program başlangıç
For Dongu=1 To 16 '
Print At 2,Dongu,"#" '2 satırın "Dongu" sütünuna "#" yaz
DelayMS 100 '100ms bekle
Next '
For Dongu=1 To 16 '
Print At 2,Dongu," " '2 satırın "Dongu" sütünuna " " yaz
DelayMS 100 '
Next '
GoTo basla '
hata:
Print At 1,satir,"Hata"
Return
kesme: 'kesme alt programı
Disable 'kayıcıların içeriğini sakla
HSerIn 1000,hata,[GelenBilgi] 'Hardware Usart Kullanarak bilgiyi al '"gelenbilgi" 'değişkeninin içeriğine at eğer timeout olursa (1000 ms) "Hata" ya dallan
Print At 1,1,"Gelen Deger ",Dec GelenBilgi 'gelen bilginin değerini yazdır
RCIF = 0 'USART Receive interrupt Flag Temizleniyor
Resume
Enable 'tüm kayıtlı reg. tekrar yüklenip keseden çıkılıyor
End 'program sonu
Device 16F648A
Config HS_OSC,WDT_OFF , PWRTE_OFF , CP_OFF , MCLRE_OFF
Xtal 20
CMCON = 7
On_Interrupt GoTo INT
Symbol GIE =INTCON.7
Symbol PEIE =INTCON.6
Symbol RCIE =PIE1.5
Symbol RCIF =PIR1.5
All_Digital = TRUE
Pulsin_Maximum 2700
SDA_Pin PORTB.7
SCL_Pin PORTB.6
Declare Slow_Bus On
Hserial_Baud = 9600 ' Set baud rate to 9600
Hserial_RCSTA = %10010000 ' Enable Hardware USART receive
Hserial_TXSTA = %00100000 ' Set Hardware USART parameters
Hserial_Clear On
'**********RF TANIMLAMALARI
Dim Header As Word
Dim bit_value As Word
Dim bit_count As Word
Dim K As Byte
Dim DASTOP As Word
Dim PP As Dword
Dim GRUPH As PP.Byte3
Dim GRUPL As PP.Byte2
Dim ID As PP.Byte1
Dim COM As PP.Byte0
Dim SGRUP As Word
Dim ST As Bit
Symbol _RFIN =PORTB.5
Symbol LED =PORTA.1
'*********PCF TANIMLAMALARI
Dim SN As Byte
Dim _SN As Byte
Dim DK As Byte
Dim SA As Byte
Dim GUN As Byte
Dim AY As Byte
'*********EPROM TANIMLAMLARI
Dim ADRES As Word
Dim FTEMP As Byte
Dim FLAG As Byte
Dim FP As 222
'*********MAIN TANIMLAMALARI
Dim GON[6] As Byte
Dim ADEPROM As Word
Dim TEMP As Word
Dim T As Byte
Dim RCTEMP As Byte
Symbol START =PORTA.3
Dim CUNT As Word
TRISB=%00100010
PORTB=0
TRISA=%00000100
PORTA=0
Header=0
bit_value=0
bit_count=0
ADRES=0
GIE=1
PEIE=1
RCIE=1
SGRUP=8520
GoTo MAIN
INT:
Context Save
GIE = 0
While GIE = 1
GIE = 0
PEIE = 0
PEIE = 0
Wend
RCTEMP =RCREG
If RCTEMP="R" Then GoTo YOLLA
Context Restore
MAIN:
RCIF=0
GoSub RFIN
If SGRUP=PP.Word1 Then GoSub DEGERLENDIR
GoTo MAIN
RFIN:
.
.
.
Return
DEGERLENDIR:
Set LED
BusIn %10100000,3,[DK,SA,GUN,AY]
BusOut %10100010,ADRES,[AY,GUN,SA,DK,PP.Byte1,"#"]
ADRES= ADRES + 5
DelayMS 1000
Clear LED
PP=0
Return
'********************************************************
GoTo MAIN
'**********************************************
YOLLA:
RCTEMP=0
ADEPROM=0
CUNT=1
KONT: If ADEPROM>30010 Then CIKIS
BusIn %10100010,ADEPROM,[GON[5],GON[4],GON[3],GON[2],GON[1],GON[0]]
GON[5]=GON[5] & %00011111
GON[4]=GON[4] & %00111111
HSerOut [13]
HSerOut [Dec4 CUNT,"* "]
HSerOut [Hex2 GON[5],"/"]
HSerOut [Hex2 GON[4],"-"]
HSerOut [Hex2 GON[3],":"]
HSerOut [Hex2 GON[2],"="]
HSerOut [Dec3 GON[1]]
HSerOut [13]
If GON[0] ="#" Then
CIKIS:
GIE=1
PEIE=1
RCIE=1
PP=0
GoTo MAIN
EndIf
ADEPROM=ADEPROM+5
Inc CUNT
GoTo KONT
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?