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

SAADC has strange periodic noise after power off/on

Hi,guys. I have a problem when dealing with NRF52's SAADC using nRF5_SDK_13.0.0_04a0bfd. The problem is after downloading and run the program using JLink, everything works fine, the values sampled by SAADC have little jitters. But if we shutdown NRF52 then power it on, sampled results get large periodic jitters. Below are two plot pictures contains the raw data sampled by SAADC in two situations with 500HZ sample rate.The input signal is 5HZ sin wave, you can see from the first figure that the sampled signal is just ok, but the second has large jitters. The only difference is we issued a power on sequence in the second situation. In all situations we usenrf_drv_saadc_sample_convert to get the adc result. the configuration of saadc is single end, 1/6 gain,burst enabled and 4x oversamle.

image description

Another thing is that, when we use nRF5_SDK_12 with ppi and DMA, there're no such jitters in whatever situation. Any suggestions to figure out such problem? Thanks!

Parents
  • Hi, sorry for the lack of information. On reset condition, we get the second result. In SDK13, we first did the sampling in gpio interrupt handler but then changed that in FreeRTOS's periodic timer's handler in order to find out the problem. Either circumstances had the same problem. Here is some code snippets:

    first method

    // this gpio interrupt is triggered every 2ms
    void gpio_int_handler(){
        ... 
        nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_AIN4, &raw_data);
        ...
    }
    

    second method

    static void timeout_handler(TimerHandle_t xTimer) {
        ... 
        nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_AIN4, &raw_data);
        ...
    }
    
    period_timer = xTimerCreate("perio", 2, pdTRUE, NULL, timeout_handler);
    

    we do not use PPI in SDK13. All of the sampled values stored in a frame buffer are transmitted to phone through BLE. This is done on our custom board. I have the DK, but haven't tested it on it. Thanks for your response!

Reply
  • Hi, sorry for the lack of information. On reset condition, we get the second result. In SDK13, we first did the sampling in gpio interrupt handler but then changed that in FreeRTOS's periodic timer's handler in order to find out the problem. Either circumstances had the same problem. Here is some code snippets:

    first method

    // this gpio interrupt is triggered every 2ms
    void gpio_int_handler(){
        ... 
        nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_AIN4, &raw_data);
        ...
    }
    

    second method

    static void timeout_handler(TimerHandle_t xTimer) {
        ... 
        nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_AIN4, &raw_data);
        ...
    }
    
    period_timer = xTimerCreate("perio", 2, pdTRUE, NULL, timeout_handler);
    

    we do not use PPI in SDK13. All of the sampled values stored in a frame buffer are transmitted to phone through BLE. This is done on our custom board. I have the DK, but haven't tested it on it. Thanks for your response!

Children
No Data
Related