Banksel Eecon1
Bcf Intcongie
Bsf Eecon1wren
Movlw H'55'
Movwf Eecon2
Movlw H'aa'
Movwf Eecon2
Bsf Eecon1wr
Bsf Intcongie
Yazma_bekle
Btfsc Eecon1wr
Goto Yazma_bekle
Bcf Eecon1wren
Return
Eeprom_oku
Banksel Eecon1
Bsf Eecon1rd
Banksel Eedata
Movf Eedataw
Return
Ana_program
Banksel Trisb
Clrf Trisb
Banksel Portb
Clrf Portb
Movlw H'0a'
Banksel Eeadr
Movwf Eeadr
Movlw H'97'
Movwf Eedata
Call Eeprom_yaz
Clrf Eedata
Banksel Eeadr
Movlw H'0a'
Movwf Eeadr
Call Eeprom_oku
Banksel Portb
Movwf Portb
Don
Goto Don
End
;----------------------------------------------------------
; 7 6 5 4 3 2 1 0
;eecon1 [eepgd - N/a - N/a - N/a - Wrerr - Wren - Wr - Rd]
;eepgd: Program Bellegi Yada Veri Bellegi Secimi Icin (1
rogram Bellegi - 0:veri Bellegi )
;wrerr: Yazim Işlemi Bir Sebeple Erken Biterse (1:hata Olustu - 0:yazim Basarili )
;wren : Eeprom Yazma Yetkisi (1:yazim Icin Izinli - 0:yazma Izni Yok )
;wr : Eeproma Veri Yazma Kontrolu (1:veri Yazilir - 0:yazma Sonlandirilir)
;rd : Eeprom Okuma Kontrolu (1:eeprom Okuma Modu - 0
kuma Modu Iptal )