Microchip Technology DM164130-9 ユーザーズマニュアル
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>);