Open Drain output readable as input (external signal level)?
I have not tried, I would need this 'feature':
Have a GPIO pin configured as Open Drain output, driven by the MCU. If MCU sets it to high but on the outside an external chip drives it low - could I read the status on the external pin without to change the direction of the GPIO?
Do I see the signal level on the pin or would I read back my '1' I have written to output register?
(I know, I can read back on outputs, but my understanding is: it reads back the output register value, not really the signal level, e.g. if there would be a short.)
Why: Assume I would try to implement an I2C in GPIO mode (I would need 4 Mbps which is not supported by the native I2C peripheral). So, for the SDA line I use Open Drain out. But during the phase for the ACK/NACK bit which is driven by the external I2C slave, I want to read how this external SDA signal is driven, e.g. low for ACK.
Changing the direction of MCU GPIO pin all the time, in order to read the SDA input for 1 clock period, would be time consuming and creates overhead on my 'I2C GPIO pattern'.
So, reading back the external signal level on a GPIO output (instead of reading back the output register value) would be great.
Maybe somebody knows or has done already (before I will try it).
Thank you.
Torsten Jaekel
