Bende Pic Konusunda Yeniyim Denedigim Ornekleri Buraya Yollucam Bi Zamanlar Arayipta Bulamadigim Seylerdi Cunku Belki Birilerinin Isine Yarar Umarim Kalin Saglicakla
list P=16f877a
include "p16f877a.inc"
__config H'3f3a'
;genel Degiskenler
#define Rs_port Portc
#define Rs_tris Trisc
#define Rs_tx 6
#define Rs_rx 7
rs232_data Equ 0x20
sayac Equ 0x21
delay_sayac Equ 0x22
Org 0
Goto Ana_program
rs232_delay1
Movlw .171
Banksel Delay_sayac
Movwf Delay_sayac
Decfsz Delay_sayac
Goto $-1
Nop
Return
rs232_delay2
Movlw .81
Banksel Delay_sayac
Movwf Delay_sayac
Decfsz Delay_sayac
Goto $-1
Nop
Return
rs232_init
Banksel Rs_tris
Bcf Rs_tris,rs_tx
Bsf Rs_tris,rs_rx
Banksel Rs_port
Bsf Rs_port,rs_tx
Return
low_level
Bcf Rs_port,rs_tx
Call Rs232_delay1
Return
high_level
Bsf Rs_port,rs_tx
Call Rs232_delay1
Return
rs232_read
Btfsc Rs_port,rs_rx
Goto Rs232_read
Call Rs232_delay2
Movlw 0x08
Movlw Sayac
rs_read_tekrar
Call Rs232_delay1
Bcf Status,c
Btfsc Rs_port,rs_rx
Bsf Status,c
Rrf Rs232_data,f
Decfsz Sayac,f
Goto Rs_read_tekrar
Return
rs232_write
Movlw 0x08
Movwf Sayac
Call Low_level
rs_write_tekrar
Btfsc Rs232_data,0
Call High_level
Btfss Rs232_data,0
Call Low_level
Rrf Rs232_data,f
Decfsz Sayac,f
Goto Rs_write_tekrar
Call High_level
Return
ana_program
Call Rs232_init
devam
Call Rs232_read
Call Rs232_write
Goto Devam
end