After a write sequence has been initiated, clearing the WREN bit will not affect this write cycle. The WR bit will be inhibited from being set unless the WREN bit is set. At the completion of the write cycle from Microprocessor PIC16LF871 Code Extraction, the WR bit is cleared in hardware and the EE Write Complete Interrupt Flag bit (EEIF) is set.
The user can either enable this interrupt or poll this bit. EEIF must be cleared by software. To Unlock Microcontroller‘s program memory location, the user must write two bytes of the address to the EEADRL and EEADRH registers, set the EEPGD control bit (EECON1<7>), and then set control bit RD (EECON1<0>).
Once the read control bit is set, the program memory Flash controller will use the second instruction cycle to read the data. This causes the second instruction immediately following the “BSF EECON1,RD” instruction to be ignored only when Copy Microcontroller PIC16F688 Heximal. The data is available in the very next cycle, in the EEDATL and EEDATH registers; therefore, it can be read as two bytes in the following instructions.
EEDATL and EEDATH registers will hold this value until another read or until it is written to by the user (during a write operation).
Note 1: The two instructions following a program memory read are required to be NOP’s. This prevents the user from executing a two-cycle instruction on the next instruction after the RD bit is set.
2: If the WR bit is set when EEPGD = 1, it will be immediately reset to ‘0’ and no operation will take place.
The Synchronous Serial Port (SSP) module is a serial interface used to communicate with other peripheral or microcontroller devices. These peripheral devices may be serial EEPROMs, shift registers, display drivers, A/D converters, etc. The SSP module can operate in one of two modes:
- Serial Peripheral Interface (SPI™)
- Inter-Integrated Circuit (I2C™)
An overview of I2C operations and additional information on the SSP module can be found in the “PICmicro® Mid-Range MCU Family Reference Manual” (DS33023). Refer to Application Note AN578, “Use of the SSP Module in the Multi-Master Environment” (DS00578).