English
Language : 

PIC16F1847_13 Datasheet, PDF (113/440 Pages) Microchip Technology – 18/20/28-Pin Flash Microcontrollers with XLP Technology
11.6 Write/Verify
Depending on the application, good programming
practice may dictate that the value written to the data
EEPROM or program memory should be verified (see
Example 11-6) to the desired value to be written.
Example 11-6 shows how to verify a write to EEPROM.
EXAMPLE 11-6: EEPROM WRITE/VERIFY
BANKSEL EEDATL
;
MOVF EEDATL, W ;EEDATL not changed
;from previous write
BSF
EECON1, RD ;YES, Read the
;value written
XORWF EEDATL, W ;
BTFSS STATUS, Z ;Is data the same
GOTO WRITE_ERR ;No, handle error
:
;Yes, continue
PIC16(L)F1847
 2011-2013 Microchip Technology Inc.
Preliminary
DS40001453D-page 113