How can I vary the sampling rate for the ADC i.e. I need to read 250 times at intervals of 4ms. Is it possible?
Also where can I find documents which explains about ADUcm3029?
The ADuCM3029 ADC sampling rate can be varied up to 1.8 Msps using the multiple conversion mode. But for sample rates lower that 10ksps you must do dummy reads due to the ADC must not be remain idle for more than 100uS.
For your requirement, it is advisable to use RTC or Timers to generate timings for that 250 sps sampling rate. You can setup the RTC or Timers to generate an interrupt every 4mS then get the sampled value of the ADC in single conversion mode. While waiting for the interrupt, you may put the microcontroller into low power modes (flexi or hibernate) or you can do other tasks.
You may refer to the ADuCM302x BSP example projects on how to use the ADC, RTC and Timers.
For more information about the ADuCM3029/ADuCM3027, you can browse the product page at:
For the Hardware Reference Manual:
For the Board Support Package of ADuCM302x EZ-Kit:
As you said,
1.Please can you provide sample code for this since I am able to put the controller in flexi mode with comparator active.
but I need adc input readings also not just waking up after threshold is crossed.
2. Also, I am unable to see the ADC results in result buffer.
3. How to run reading ADC analog input with a coin cell battery? I can only read with USB connection now.