AnsweredAssumed Answered

K60 open drain output GPIO

Question asked by Andrey Korol on May 14, 2019
Latest reply on May 17, 2019 by Robin_Shen


       I'm try to usage gpio PTE9 as open drain output on K60DN, but looks like it's still push-pull.


Init code:

    CLOCK_EnableClock(kCLOCK_PortE);  //enable clock on port E
    GPIOE->PCOR = 1U << 9;  //clear output register on PTE9
    GPIOE->PDDR |= (1U << 9); //configure PTE9 as output
    GPIOE->PCOR = 1U << 9; //clear output register on PTE9
    PORTE->PCR[9] =  PORT_PCR_ODE(1) | PORT_PCR_MUX(1); //enable opendrain and set mux to "gpio mode" on PORTE, pin9 (all pull - disabled)
    GPIOE->PSOR = 1U << 9; //set output register on PTE9

After last line i expect zero voltage on this pin (couse it's connect to ground) - but i'm still have 3V on this pin. This pin don't have any external pull-up.


If i clear output register:

GPIOE->PCOR = 1U << 9;

voltage level on this pin drops to zero.


I expect to have GND on this pint in case  setted output register and float pin on cleared register.  Is any way to solve this situation?