Page 190 in datasheet..take care in I2C mode
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. To ensure proper operation of the module, pull-up resistors must be provided externally to the SCL and SDA pins.
I did not use SCL and SDA pins for I2C purpose. I just want those two pins as normal digital outputs(SSPEN = 0). so can i have circuit as follows?
SCL pin - 330E - LED(Anode) - LED(Cathode) - GND
SDA pin - 330E - LED(Anode) - LED(Cathode) - GND
You can still use A4 as an input and it still works as an output if you provide it a current source from VDD. All an open drain output can't do is produce a current by itself, if you add a pull-up resistor to VDD it still works as a logic output as normal.
Both SCL and SDA lines are "open drain" drivers. What this means is that the chip can drive its output low, but it cannot drive it high. For the line to be able to go high you must provide pull-up resistors to the Vcc supply.