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

What is the EVENTDONE of SAADC oversampling?

I'm trying to make an application which displays signal transferred via bluetooth.

To reduce computing time on the tablet, I want to apply oversampling in nRF52840.

The problem is that I'm not sure whether the NRF_DRV_SAADC_EVT_DONE means oversampled and averaged data is ready to use.

I found that the product specification and answer of a related question about SAADC oversampling names to event as different things.

But it was not able to find specific identifier from the nrfx_saadc.h file. There only exist NRFX_SAADC_EVT_DONE, NRFX_SAADC_EVT_LIMIT, and NRFX_SAADC_EVT_CALIBRATEDONE.

How can I detect when the oversampling is done?

Parents
  • Hi,

    It is important to distinguish between the events generated by the peripheral (EVENTS_END/EVENTS_DONE/EVENTS_RESULTDONE), and the software events passed to the application from the driver (NRF_DRV_SAADC_EVT_DONE).

    From the peripherals perspective, the DONE event means that a single sample is completed, but no result is yet ready if oversample is enabled. When the averaged result by the oversampling mechanism is ready, the peripheral will generate the RESULTDONE event, but at this point, the result is not yet transferred from the peripheral to the sample buffer in RAM. The result is first available in the RAM buffen when the END event is generated by the peripheral.

    The naming of the software event from the driver may be a bit confusing, as the NRF_DRV_SAADC_EVT_DONE event in actually triggered when the driver receives the NRF_SAADC_EVENTS_END event from the peripheral. To sum up, the result is ready for use when you get this event in the driver, all oversampling is completed.

    Best regards,
    Jørgen

Reply
  • Hi,

    It is important to distinguish between the events generated by the peripheral (EVENTS_END/EVENTS_DONE/EVENTS_RESULTDONE), and the software events passed to the application from the driver (NRF_DRV_SAADC_EVT_DONE).

    From the peripherals perspective, the DONE event means that a single sample is completed, but no result is yet ready if oversample is enabled. When the averaged result by the oversampling mechanism is ready, the peripheral will generate the RESULTDONE event, but at this point, the result is not yet transferred from the peripheral to the sample buffer in RAM. The result is first available in the RAM buffen when the END event is generated by the peripheral.

    The naming of the software event from the driver may be a bit confusing, as the NRF_DRV_SAADC_EVT_DONE event in actually triggered when the driver receives the NRF_SAADC_EVENTS_END event from the peripheral. To sum up, the result is ready for use when you get this event in the driver, all oversampling is completed.

    Best regards,
    Jørgen

Children
Related