TSSP module in I2C mode, fully implements all slave functions, except general call support, and provides interrupts on Start and Stop bits to Read MCU Microchip PIC16F876 Flash in hardware to facilitate firmware implementations of the master functions.
The SSP module implements the Standard mode specifications, as well as 7-bit and 10-bit addressing. Two pins are used for data transfer. These are the RC6/TX/CK/SCK/SCL/SEG9 pin, which is the clock (SCL), and the RC7/RX/DT/SDI/SDA/SEG8 pin, which is the data (SDA).
The SSP module functions are enabled by setting SSP enable bit SSPEN (SSPCON<5>).
The SSP module has five registers for the I2C operation, which are listed below.
SSP Control Register (SSPCON)
SSP Status Register (SSPSTAT)
Serial Receive/Transmit Buffer (SSPBUF)
SSP Shift Register (SSPSR) – Not directly accessible
SSP Address Register (SSPADD)
The SSPCON register allows control of the I2C
operation. Four mode selection bits (SSPCON<3:0>)
allow one of the following I2C modes to be selected:
I2C Slave mode (7-bit address)
I2C Slave mode (10-bit address)
I2C Slave mode (7-bit address), with Start and Stop bit interrupts enabled to support Firmware when Reading it Out from Locked PIC18F448 MCU Data
Master mode
I2C Slave mode (10-bit address), with Start and Stop bit interrupts enabled to support Firmware Master mode.
I2C Start and Stop bit interrupts enabled to support Firmware Master mode; Slave is idle Selection of any I2C mode with the SSPEN bit set forces the SCL and SDA pins to be open drain, provided these pins are programmed to inputs by setting the appropriate TRISC bits.
Pull-up resistors must be provided externally to the SCL and SDA pins for proper operation of the I2C module. Additional information on SSP I2C operation can be found in the “PICmicro® Mid-Range MCU Family Reference Manual” (DS33023).