Tool/software:
Hello,
I currently have switches connected to inputs IN0 through IN9. When the switches are floating, I observe around 1V. When connected to GND, the voltage drops to approximately 0.8V, and when connected to the battery, it rises to about 5.9V. These levels are expected.
At the moment, I am operating in ADC mode and monitoring the input voltages by continuously reading the ANA_STAT0,ANA_STAT1,...ANA_STAT4 registers. However, this approach causes significant CPU load.
My requirement is to detect when any input voltage reaches either approximately 0.8V (GND level) or 5.9V (battery level), without constant polling.
I would like to know:
In ADC mode: Is there a mechanism that allows me to detect or be notified when the input reaches these levels, without continuously reading the ADC values?
In Comparator mode: Is it possible to configure voltage thresholds (e.g., <1V or >5V) and generate an interrupt or status flag when an input crosses those thresholds?
In summary, is it feasible to implement such level detection efficiently in both ADC and Comparator modes ?
Thank you in advance for your support.
Best regards.