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?
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
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.
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.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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.
I try to remove R78 of TWR-K60D100M board.
During debug, after last line I get 0.1v on this pin.