This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Selective sampling of ADC channels at run time

I am using a 52810 custom board and the SAADC module.

It is used for sampling one analog input through AIN2 and the battery voltage directly by setting the pin to VDD

As per the documentation, since more than one channel is configured/enabled, it goes into scan mode.

i need to measure the analog input at AIN2 for 15 seconds.

However, i do not need to measure the battery voltage in every scan. I only want to measure it once every 5 seconds to check for voltage drop.

Is this possible ?

Regards

Chary BS

Parents
  • Thank you Einar for the update. This new API V2, does it have any dependency with the soft device version ? 

    I am using SDK17.0.0_9d13099, S112...

    Regards

    Chary BS

  • Ok, i will do as you said and try to use the V2 API. But before that i have two small queries -

    1. As you know the 52810 has only two RTCs. I am using the soft device so RTC0 is dedicated for that. And RTC1 is used for app_timer.  I saw an saadc low power example on the Devzone that uses RTC instead of timer for lower power consumption, however, it is written for the 52832 and uses RTC2, which  does not exist on the 52810. Is there a way by which i can implement that on the 52810 ? Because mine is a battery operated device and i find that the battery drains very fast...it must be due to this ?

    2. I need to implement a calendar clock functionality on the 52810 without using any external RTC chip. The accuracy need not be very high, up to seconds level. Even if it is accurate up to a minute it is sufficient... with periodic correction from a smart phone. Is it possible to  do this ?

    Regards

    Sreenivasa Chary

Reply
  • Ok, i will do as you said and try to use the V2 API. But before that i have two small queries -

    1. As you know the 52810 has only two RTCs. I am using the soft device so RTC0 is dedicated for that. And RTC1 is used for app_timer.  I saw an saadc low power example on the Devzone that uses RTC instead of timer for lower power consumption, however, it is written for the 52832 and uses RTC2, which  does not exist on the 52810. Is there a way by which i can implement that on the 52810 ? Because mine is a battery operated device and i find that the battery drains very fast...it must be due to this ?

    2. I need to implement a calendar clock functionality on the 52810 without using any external RTC chip. The accuracy need not be very high, up to seconds level. Even if it is accurate up to a minute it is sufficient... with periodic correction from a smart phone. Is it possible to  do this ?

    Regards

    Sreenivasa Chary

Children
  • Hi Chary,

    1. I cannot say if the SAADC related code is responsible for your high current consumption without knowing more about your application. In general, if you do not need to sample with a very high frequency and very high accuracy (the former would prevent a low power solution anyway), then you can trigger SAADC sampling from SW regularly from an app timer. This makes the SAADC driver low power mode concept irrelevant.

    2. Yes you can do this by basing your calendar clock on the app timer. You may have some jitter, but the average accuracy would be equal to the accuracy of your 32.768 kHz clock source (so if you use a 20 ppm crystal, that is the accuracy you get).

    Einar

Related