Microchip Technology AC244045 Hoja De Datos
2010-2012 Microchip Technology Inc.
DS41440C-page 115
PIC16(L)F1825/1829
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
practice may dictate that the value written to the data
EEPROM or program memory should be verified (see
) to the desired value to be written.
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
;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