Hello,
I have an application where I want to read the voltage of a battery every 5 minutes for this I'm using the Zephyr ADC library. But now I also want to read the ADC value of a sensor with a high sampling rate of ~2 kHz or higher. I also want to use the limit feature to be notified when the ADC value of the sensor drops below a certain value. For doing this I'm using the NRFX library. I found this example. And modified it to work the way I need it to. Now when I add both the battery measurement and the sensor reading together into one project I get an error that the IQR has been set multiple times:
gen_isr_tables.py: error: multiple registrations at table_index 7 for irq 7 (0x7) Existing handler 0x387cf, new handler 0x23899 Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?
I have done some research and suspect that I cannot use NRFX with the Zephyr ADC driver. So I need to do both with NRFX. Is this assumption correct?
If I configure SAADC to be in the advanced mode, it can not be configured to be in simple mode for a different channel at the same time. Is this the case?
I also looked at this example where multiple channels are sampled simultaneously. This would read both channels at 2 kHz. For this I have to configure the sampling buffer to have enough space to hold the values from both channels, which wastes a lot of memory. And how would this affect the power consumption? I could also switch channels every 5 minutes for one cycle as described here. But this looks a bit too complicated to just read two channels at different intervals.
What would be the best way to solve this problem?
Another question: Will the sampling rate have an effect on the reaction time of the limit being set or are they independent of each other?
Best regards,
Jonas