- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I’m developing a project which should run with 2 different configurations.
The configuration is set at startup and will not change runtime.
The different configurations regards the settings of two GPIO (GPIO1, GPIO2) and an OpAmp.
First configuration:
- OpAmp is enabled
- GPIO1 is an Analog and it is an input of Opamp(+)
- GPIO2 is an Analog and it is an output of Opamp
Second configuration:
- OpAmp is disabled
- GPIO1 is a Digital Input (High Impedance)
- GPIO2 is a Digital Output (Strong Drive)
I’ve seen on the datasheet that it is possible to configure:
- GPIO1: both Analog and Digital Input
- GPIO2: both Analog and Digital Output
But the datasheet notice that “should be used with care”, and I can’t find any examples.
So I would like to ask if there are some examples of GPIO configured both Analog and Digital.
Thank you
Maurizio
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Easiest solution would be to set the pin's properties at run-time after detecting the mode the project must run.
there are a few APIs to set the required mode for a pn as void Pin_SetDriveMode (uint8 mode).
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Easiest solution would be to set the pin's properties at run-time after detecting the mode the project must run.
there are a few APIs to set the required mode for a pn as void Pin_SetDriveMode (uint8 mode).
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it works.
I configured with TopDesign:
- GPIO1: both Analog and Digital Input
- GPIO2: both Analog and Digital Output.
And at startup I set the Drive Mode of GPIO2 to "High Impedance Analog" for Analog or "Strong Drive" for Digital Output.
For GPIO1 the Drive Mode must not be changed, it is "High Impedance Digital" for Analog and for Digital Input.
Thank you Bob
Bye
Maurizio