DOWNLOAD MAIN
PIC_EEPROM_Data_Read macro
; by Randy Gamage
; Reads a byte from the PIC's
; on-board EEPROM space (256 bytes available)
; INPUT: FlashAddr0 = address to read from
; OUTPUT: FlashData and W both
; contain the value that was read from the EEPROM
; ALSO: Auto-Increments FlashAddr0 for
; easy sequential reads
movf FlashAddr0,W
bank2
movwf EEADR^0x100
bank3
bcf EECON1^0x180,EEPGD
bsf EECON1^0x180,RD
bank2
movf EEDATA^0x100,W
bank0
movwf FlashData
incf FlashAddr0
endm
|