YILDIZEREN
Üye
- Katılım
- 15 Kas 2010
- Mesajlar
- 7
- Puanları
- 1
- Yaş
- 36
MERHABA ARKADAŞLAR AŞAGIDAKİ KODLARIN C DİLİNE ÇEVRİLMESİ LAZIM ÇOK ACİL
VERİCİ DEVRESİ
@ DEVICE pic16F628
@ DEVICE pic16F628, WDT_OFF
@ DEVICE pic16F628, PWRT_OFF
@ DEVICE pic16F628, PROTECT_OFF
@ DEVICE pic16F628, MCLR_ON
@ DEVICE pic16F628, XT_OSC
include "modedefs.bas"
VERI var byte 56
SAY VAR BYTE
SAY=0
VERI=0
TRISB=0
TRISA=%00011111
CMCON=7
PORTB=0
PORTA=0
BASLA:
IF PORTA.0=0 THEN VERI=10
IF PORTA.1=0 THEN VERI=20
IF PORTA.2=0 THEN VERI=30
IF PORTA.3=0 THEN VERI=40
IF PORTA.4=0 THEN VERI=50
IF VERI>0 then GOSUB GONDER
VERI=0
goto basla
GONDER:
SEROUT2 PORTB.0,396,[REP$AA\5,REP$00\5,REP$FF\5]
serout2 PORTB.0,396,["T","X","R","X",dec VERI]
return
end
ALICI DEVRESİ İÇİN
@ Device PIC16F877
@ Device PIC16F877, WDT_OFF
@ Device PIC16F877, CPD_OFF
@ Device PIC16F877, PWRT_OFF
@ Device PIC16F877, BOD_OFF
@ Device PIC16F877, WRT_OFF
@ Device PIC16F877, PROTECT_OFF
@ Device PIC16F877, LVP_OFF
@ Device PIC16F877, DEBUG_OFF
@ Device PIC16F877, XT_OSC
include "modedefs.bas"
ALICI var byte 56 SAY VAR BYTE 57
SAY=0
ALICI=0
TRISA=%11111111
TRISB=0
TRISC=0
TRISD=0
TRISE=0
PORTA=0
PORTB=0
PORTC=0
PORTD=0
PORTE=0
ADCON1=6
PR2 = 255
CCPR1L = 64
CCP1CON = %00001100
T2CON = %00000110
BASLA:
SERIN2 PORTA.0,396,3,BASLA,[WAIT("TXRX"),dec ALICI]
SAY=ALICI
IF ALICI=10 THEN PORTB=1
IF ALICI=20 THEN PORTB=2
IF ALICI=30 AND CCPR1L<254 THEN CCPR1L = CCPR1L+1
IF ALICI=40 AND CCPR1L>1 THEN CCPR1L = CCPR1L-1
IF ALICI=50 THEN PORTB=0
ALICI=0
GOTO BASLA
END
VERİCİ DEVRESİ
@ DEVICE pic16F628
@ DEVICE pic16F628, WDT_OFF
@ DEVICE pic16F628, PWRT_OFF
@ DEVICE pic16F628, PROTECT_OFF
@ DEVICE pic16F628, MCLR_ON
@ DEVICE pic16F628, XT_OSC
include "modedefs.bas"
VERI var byte 56
SAY VAR BYTE
SAY=0
VERI=0
TRISB=0
TRISA=%00011111
CMCON=7
PORTB=0
PORTA=0
BASLA:
IF PORTA.0=0 THEN VERI=10
IF PORTA.1=0 THEN VERI=20
IF PORTA.2=0 THEN VERI=30
IF PORTA.3=0 THEN VERI=40
IF PORTA.4=0 THEN VERI=50
IF VERI>0 then GOSUB GONDER
VERI=0
goto basla
GONDER:
SEROUT2 PORTB.0,396,[REP$AA\5,REP$00\5,REP$FF\5]
serout2 PORTB.0,396,["T","X","R","X",dec VERI]
return
end
ALICI DEVRESİ İÇİN
@ Device PIC16F877
@ Device PIC16F877, WDT_OFF
@ Device PIC16F877, CPD_OFF
@ Device PIC16F877, PWRT_OFF
@ Device PIC16F877, BOD_OFF
@ Device PIC16F877, WRT_OFF
@ Device PIC16F877, PROTECT_OFF
@ Device PIC16F877, LVP_OFF
@ Device PIC16F877, DEBUG_OFF
@ Device PIC16F877, XT_OSC
include "modedefs.bas"
ALICI var byte 56 SAY VAR BYTE 57
SAY=0
ALICI=0
TRISA=%11111111
TRISB=0
TRISC=0
TRISD=0
TRISE=0
PORTA=0
PORTB=0
PORTC=0
PORTD=0
PORTE=0
ADCON1=6
PR2 = 255
CCPR1L = 64
CCP1CON = %00001100
T2CON = %00000110
BASLA:
SERIN2 PORTA.0,396,3,BASLA,[WAIT("TXRX"),dec ALICI]
SAY=ALICI
IF ALICI=10 THEN PORTB=1
IF ALICI=20 THEN PORTB=2
IF ALICI=30 AND CCPR1L<254 THEN CCPR1L = CCPR1L+1
IF ALICI=40 AND CCPR1L>1 THEN CCPR1L = CCPR1L-1
IF ALICI=50 THEN PORTB=0
ALICI=0
GOTO BASLA
END