2019-07-16 02:00 AM
Hi,
I'm currently figuring out about the new ANA0 / ANA1 pins.
As far as I understand, those pins are always connected to the ADC so that I don't need to touch the GPIO registers in order to use those pins. Is my understanding correct?
Also I can connect those pin to PA0 / PA1 using ANAx_SEL bits in SYSCFG_PMCR register. In this case is it possible to short or damage the circuit/chip when I set different signal between ANAx and PAx?
Thanks a lot!
Solved! Go to Solution.
2019-07-16 02:35 AM
Your understanding about ANA0/ANA1 is correct, they are always connected to ADC to avoid to go thru an analog switch (which is the case for all other ADC inputs, which due to its resistivity, could limit ADC sampling capacitor minimum charge time.
There is no need to any GPIO settings to use ANAx (obvious as not linked to a GPIO).
The ANAx_SEL are there for legacy usage, I did not see any rationale to use it in most cases (as there is as well other ADC inputs on PAx).
Yes, there is a small risk of damage, e.g. if you externally drive voltage on ANA0/ANA1 with low impedance and at same time driving PA0/PA1 in output or input while the 'switch' between ANAx/PAx is closed using ANAx_SEL.
Major concern of uncontrolled usage of IOs is current leakage in your system.
As a general rule, risk is there whenever the limit values in datasheet are not respected (i.e. injected current, input voltages, etc..). Otherwise, IOs are quite robusts and tolerant to most misuses.
So, to avoid issue, in case ANAx_SEL=1 is used, ANAx pin must be left open in the system.
2019-07-16 02:12 AM
What chip are you talking about?
2019-07-16 02:16 AM
I'm talking about STM32MP157x, and possibly all STM32 MPU series.
2019-07-16 02:35 AM
Your understanding about ANA0/ANA1 is correct, they are always connected to ADC to avoid to go thru an analog switch (which is the case for all other ADC inputs, which due to its resistivity, could limit ADC sampling capacitor minimum charge time.
There is no need to any GPIO settings to use ANAx (obvious as not linked to a GPIO).
The ANAx_SEL are there for legacy usage, I did not see any rationale to use it in most cases (as there is as well other ADC inputs on PAx).
Yes, there is a small risk of damage, e.g. if you externally drive voltage on ANA0/ANA1 with low impedance and at same time driving PA0/PA1 in output or input while the 'switch' between ANAx/PAx is closed using ANAx_SEL.
Major concern of uncontrolled usage of IOs is current leakage in your system.
As a general rule, risk is there whenever the limit values in datasheet are not respected (i.e. injected current, input voltages, etc..). Otherwise, IOs are quite robusts and tolerant to most misuses.
So, to avoid issue, in case ANAx_SEL=1 is used, ANAx pin must be left open in the system.
2019-07-16 04:41 AM
Well explained, thanks!