How to read eeprom M27C64A with pic18f4520, should i enable and disable the chip enable as well as output enable inside the loop while increasing the address?
Can someone suggest me some code or ideas.
Thanks
The eeprom has the following data from 0x00 address
x"7F" , x"97" , x"AF" , x"C5" , x"D8" , x"E8" , x"F4" , x"FB" , x"FE" , x"FB" , x"F4" , x"E8" , x"D8" , x"C5" , x"AF" , x"97" , x"7F" , x"67" , x"4F" , x"39" , x"26" , x"16" , x"0A" , x"03" , x"00" , x"03" , x"0A" , x"16" , x"26" , x"39" , x"4F" , x"67"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include "P18F4520.inc"
UDATA_ACS
var1 res 1
var2 res 1
var3 res 1
address res 1
firstadd res 1
lastadd res 1
outreg res 1
savedWREG res 1
org 0
goto main
org 100
main:
clrf PORTA
clrf TRISA ;address
clrf PORTC
clrf TRISC ;enable
setf TRISB ;input
clrf PORTD
clrf TRISD ;output
movlw 0x00
movwf firstadd
movlw 0x1f
movwf lastadd
repeat:
movff firstadd,address
loop:
movff address,PORTA
clrf PORTC ;out enable
call delay
movff PORTB,outreg
movff outreg,PORTD
setf PORTC ;out disable
incf address
movf lastadd,W
cpfslt address
goto repeat
goto loop
delay:
movwf savedWREG
movlw 0x0C
movwf var1
delayloop:
decfsz var1
goto delayloop
movf savedWREG,W
return
END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
