Microchip Technology DM164130-9 Manual Do Utilizador
![Microchip Technology](https://files.manualsbrain.com/attachments/cf42c3c895ef469f06d2e47e97fd98d738fcf5cf/common/fit/150/50/7340124dc8aa983aaf764094e2f06faab86f306c03111c5817f7e4e53fb2/brand_logo.gif)
Lessons
2012 Microchip Technology Inc.
DS41628B-page 95
EXAMPLE 3-55:
When the WR bit is set, it remains set until the write to EEPROM is complete.
3.14.7
C Language
3.14.7.1 BOTH
There are two functions that the XC8 compiler provides, which greatly simplify
EEPROM reads and writes.
EEPROM reads and writes.
EXAMPLE 3-56:
Use this to read and write single bytes from EEPROM.
;REQUIRED SEQUENCE for EEPROM write
movlw 0x55
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1, WR ;begin write
movlw 0x55
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1, WR ;begin write
eeprom_read(<addr>)
eeprom_write(<addr>,<value>);
eeprom_write(<addr>,<value>);