I'm trying to understand how to operate an open-drain I/O port on an older PIC (PIC16F1718.) My goal is to use it for bit-banged bidirectional open-drain I2C communication.
I know how to enable and disable open drain mode, but from there I'm not sure how to control it. To control the output, do I change the output value (PORTx or LATx) or do I change the pin mode (TRISx)? How do I set the registers if I want to read in a value?
I figured these questions would be straightforward to answer from the datasheet, but it doesn't show the open-drain register (ODCONx) on its I/O port logic diagram, and all it says about open-drain control is how to enable the mode.
Datasheet Page 123:
https://ww1.microchip.com/downloads/en/DeviceDoc/PIC16F-LF-1717-8-9-Data-Sheet-DS40001740D.pdf
