Hello,
How can I configure a port pin as Hi-Z state in S32DS?
I'd appreciate it if you could show me an example.
Thanks.
Solved! Go to Solution.
Hi Jetty,
The Configuration tool does not allow to dissable the buffers.
Even the No init sets the buffers as per the initial direction configured there.
But the pins can be configured for SIUL2 (which is the default muxing) and set them to inputs since the GPIO inputs have high impedance.
After the initialization, the pins can be set to Hi-Z using the Siul2_Port_Ip_SetPinDirection() if you want to have the input buffer disabled too.
Let me open a discussion with the RTD team to add this option to the Configuration tool.
Best regards,
Daniel
Hi @jetty_1012,
You didn't specify the MCU series, I assume it is S32K3xx.
The default state of the pins out of reset is Hi-Z, there is no need to initialize those pins.
Refer to the IOMUX.xlsx attached to the RM.
There is the reset state of the MSCR registers, MSCR[MUX = OBE = IBE = PUE = 0] which disables the output buffer, input buffer, and pull device.
Regards,
Daniel
Thanks for you reply. And yes, I'm using S32K312.
My problem is that I need some pins to stay Hi-Z, and other pins to be initialized as output/input before my task starts running (I'm using FreeRTOS).
And after my task starts running, I want to set directions for the pins staying Hi-Z state just now by using this API Siul2_Port_Ip_SetPinDirection. If I do not initialize them, then I cannot use the API to set their directions later.
In other word, I do not want those pins to always keep Hi-Z. I only want them to keep Hi-Z at the beginning and I need to configure them as GPO at sometime when my code is running. Any suggestions about it?
Best regards,
Jetty
Hi Jetty,
The Configuration tool does not allow to dissable the buffers.
Even the No init sets the buffers as per the initial direction configured there.
But the pins can be configured for SIUL2 (which is the default muxing) and set them to inputs since the GPIO inputs have high impedance.
After the initialization, the pins can be set to Hi-Z using the Siul2_Port_Ip_SetPinDirection() if you want to have the input buffer disabled too.
Let me open a discussion with the RTD team to add this option to the Configuration tool.
Best regards,
Daniel