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

Disabling SAADC Interrupt

Hello, 

I wonder if I can disable saadc interrupt because saadc is under control of ppi in my project and I don't even need saadc interrupt or interrupt handler.

As I know there is no way to init it without an irq handler (nrf_drv_saadc_init) so,  what if I disable it by the registers, once i have initialized it? is there any negative impact?

i think saadc hw events will still work for ppi even i disable saadc interrupts.

Best regards.

Parents
  • Hello,

    There is one thing that comes to mind is that in the saadc example, the saadc event handler is used to call:

    err_code = nrf_drv_saadc_buffer_convert(p_event->data.done.p_buffer, p_event->data.done.size);

    which needs to be called in order to set up the buffers for the next samples. 

    If you manage to do this as well using PPI, then it would be safe to skip the event handler (I think). 

    Why do you want to skip the event handler completely?

    If this is timing critical, you can use the PPI to handle the event, but you still need to convert the buffers, which you can do in the event handler. I am not sure you can skip it completely, because I don't know whether the ADC is dependent on the IRQ event handler in order to work properly.

    BR,

    Edvin

Reply
  • Hello,

    There is one thing that comes to mind is that in the saadc example, the saadc event handler is used to call:

    err_code = nrf_drv_saadc_buffer_convert(p_event->data.done.p_buffer, p_event->data.done.size);

    which needs to be called in order to set up the buffers for the next samples. 

    If you manage to do this as well using PPI, then it would be safe to skip the event handler (I think). 

    Why do you want to skip the event handler completely?

    If this is timing critical, you can use the PPI to handle the event, but you still need to convert the buffers, which you can do in the event handler. I am not sure you can skip it completely, because I don't know whether the ADC is dependent on the IRQ event handler in order to work properly.

    BR,

    Edvin

Children
  • Hello Edvin, 

    I don't use nrf_drv_saadc_buffer_convert to switch buffer, instead of it , I have set one big buffer and a counter to divide it into two halves.  And as you mentioned i use ppi unit all to handle these things. By now, i am using  nrf_saadc_int_disable(0x3F); function to disable interrupts. it seems it works. 

    Thank you .

Related