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

Read ADC in ACTIVE event nrf51822

Hi,

Today I use the app timer to start a simple 8bit ADC conversion each second and send in the irq handler.

Now I am trying to use the sw interrupt to execute some code (ADC) prior to SoftDevice110 radio send/recv to avoid needing to startup the 16Mhz crystal just to run ADC. Is the ACTIVE event designed for this or is it just to sync another timer?

I tried some and since the SoftDevice radio sends each 20ms at startup, I need to read the RTC1 tick counter and somehow see when a second has elapsed. And then the case with calling SD within low prio event (irq handler).

Any suggestions? Is it worth persuing the battery saving (cr2032) that might come out of this?

  • Hi Martin,

    I think it's not a bad idea. But if the ADC sampling interval is only 1 every second, you would not save much. Secondly, I think it's better to start the ADC on nACTIVE event, instead of ACTIVE event. Doing this you can avoid the T_prep period that we are not certain when exactly the 16MHz clock is started.

    As far as I understand the 16MHz clock is turned off only after the device enter sleep mode after radio event. So more likely you still can have the 16MHz crystal on nACTIVE event.

Related