9 years, 7 months ago.

digitalin open drain

to use digitalin, we can set mode(pull up ,pull down, pull none) but what dose it mean open drain? how to use this mode?

2 Answers

9 years, 7 months ago.

On I2C pins there is better opendrain than on other pins (no idea what the actualy difference is), but opendrain is something you use on an output, not an input. Since DigitalOut can't set mode, you should try it with DigitalInOut.

Accepted Answer
9 years, 7 months ago.

You can use the open drain configuration with I2C compliant pins SDA, SCLK.

The datasheet states: - All GPIOs support a new, configurable open-drain operating mode. - Most pins can also be configured as open-drain outputs or to have a pull-up, pull-down, or no resistor enabled.

However "Fig 38. Standard I/O pin configuration with analog input" has no open-drain enable for pin configured as digital input.

So, this means it is an error as regards input.