Page 1 of 1

open drain output

Posted: Wed Nov 06, 2019 11:13 am
by eowesi
My first question is: Does all digital pins support open drain?
Second is: I'm trying to set the fourth pin as open drain.The arduino code below didn't work. Where am I making a mistake?(Is code OK?)

Code: Select all

void setup()
{
  REG_WRITE(GPIO_PIN4_REG, GPIO_PIN4_PAD_DRIVER);
}

void loop()
{
  REG_WRITE(GPIO_OUT_W1TS_REG, BIT4); //Close output
        delay(250);
  REG_WRITE(GPIO_OUT_W1TC_REG, BIT4); //Set pin to ground
        delay(250);
}


Re: open drain output

Posted: Thu Nov 07, 2019 12:04 am
by idahowalker
https://docs.espressif.com/projects/esp ... /gpio.html look for gpio pull down and pull up disable.

Re: open drain output

Posted: Fri Nov 08, 2019 3:38 pm
by Edje11
eowesi wrote:
Wed Nov 06, 2019 11:13 am
My first question is: Does all digital pins support open drain?
No.
It's all in the datasheet described.