K60 open drain output GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K60 open drain output GPIO

1,560 Views
andreykorol1
Contributor II

Hello, 

       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?

Tags (3)
5 Replies

1,388 Views
mjbcswitzerland
Specialist V

Hi

Try connecting the output to ground using a 10..100k resistor to see whether than pulls the voltage to '0' when the output is in "OD" state.

- If it does it means it is a measurement issue.
- If it doesn't it means that the OD mode hasn't been set as expected

Regards

Mark

Complete Kinetis solutions for professional needs, training and support: http://www.utasker.com/kinetis.html
Kinetis K60/K10:
- http://www.utasker.com/kinetis/TWR-K60N512.html
- http://www.utasker.com/kinetis/TWR-K60D100M.html
- http://www.utasker.com/kinetis/TWR-K60F120M.html
- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html
- http://www.utasker.com/kinetis/ELZET80_NET-K60.html

1,388 Views
andreykorol1
Contributor II

Hi


   Mark, thanks for you help. I was added external pull-down resistor and got zero voltage on pin.


As results:

1) seems, on K60 pin in open drain mode still have weak pullup, even you switch it off in PCD register

2) i was expect same behavior to control open drain as on STM32 - writing "1" to output register will open internal mosfet and connect pin to ground. For K60 is inverse control - to connect pin to ground we need to write "0" to output register. It's my delusion.


   i was got answer to my question. Many thanks to you again, Mark.

0 Kudos

1,388 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Would you please check if the PTE9 connect to other device?

For example: the PTE9 connect to U7 by R78 on TWR-K60D100M board. If you remove the R78, then the output value should meet what you needs.

PTE9 TWR-K60D100M.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,388 Views
andreykorol1
Contributor II

I'm use custom board and at this time PTE9 is leaved floated. i'm planning to use this pin to control smd led - will be connected to anode.

0 Kudos

1,388 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I try to remove R78 of TWR-K60D100M board.

During debug, after last line I get 0.1v on this pin.

0 Kudos