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

nrf52832 saadc low power mode initializing two channels. But a channel is temporarily disabled and cannot enter the callback function.

When initializing two channels, enter scan mode。After the two channels are converted, the callback function will be entered,Read conversion results。However, the requirements of my project are as follows: the sampling rate of one channel is 250Hz, and the sampling rate of the other channel is only 0.001Hz.In order to save power consumption, the channel with sampling rate of 0.001 needs to be closed temporarily and opened only when conversion is required. But because two channels are initialized during initialization. The callback function will not be entered until the two channels are converted. When I call nrfx_ saadc_ channel_ uninit(uint8_ When the T channel) function disables this channel, the function cannot enter the callback function. Unable to read the conversion result with my sampling rate of 250Hz. Is there a good solution? thanks

Parents
  • Hi

    I think the solution in this case is to simply sample both channels at 250Hz, and only read out the value from the other channel whenever you need it (every 1000 seconds). 

    Otherwise you need to reconfigure the SAADC peripheral every time you want to sample both channels, which will add more complexity to your application. 

    Also, depending on your latency requirements you might want to use a larger buffer for the ADC, so you don't need to receive as many callbacks. 

    Best regards
    Torbjørn

Reply
  • Hi

    I think the solution in this case is to simply sample both channels at 250Hz, and only read out the value from the other channel whenever you need it (every 1000 seconds). 

    Otherwise you need to reconfigure the SAADC peripheral every time you want to sample both channels, which will add more complexity to your application. 

    Also, depending on your latency requirements you might want to use a larger buffer for the ADC, so you don't need to receive as many callbacks. 

    Best regards
    Torbjørn

Children
No Data
Related