Read from a pin set as input/output is high
Posted: Fri Nov 15, 2024 7:55 am
Hello, I stumbled upon a problem when reading a pin that is set as input/output with pulldown resistor enabled. When the pin is set to logical 0 then read works as expected. But when the pin is set to logical 1 then read is always one. Is this a normal behavior or is it a bug? I use ESP32-S3-WROOM1 MCU with ESP-IDF 5.2.1.
I found a workaround for this problem:
1. Set the output to logical 0.
2. Read the pin level.
3. Set the output to previous value.
I would expect that this should be done in ESP IDF itself because correct read value is valid only if output of input/output pin is set to logical 0.
I hope I address this correctly because I'm not sure if this is a hardware or software issue or it's just a normal behavior.
I found a workaround for this problem:
1. Set the output to logical 0.
2. Read the pin level.
3. Set the output to previous value.
I would expect that this should be done in ESP IDF itself because correct read value is valid only if output of input/output pin is set to logical 0.
I hope I address this correctly because I'm not sure if this is a hardware or software issue or it's just a normal behavior.