PIC16F/LF1946/47
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
BANKSELEEDATL
;
MOVF
EEDATL, W ;EEDATL not changed
;from previous write
BSF
EECON1, RD ;YES, Read the
;value written
XORWF
BTFSS
GOTO
:
EEDATL, W
;
STATUS, Z ;Is data the same
WRITE_ERR ;No, handle error
;Yes, continue
2010 Microchip Technology Inc.
Preliminary
DS41414A-page 117