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

51822 adc does not work normaly

i use a ppi channel 0 to connect timer2 and adc,when timer2 compare event happen,the adc task start begin.then,in the adc interrupt handler,i read the adc result into the buffer,then send the data in the buffer to a phone. then,i toggled a gpio pin in the adc interruupt handler,and inspect it through a Oscilloscope.but,the peroid of it is irregular,sometimes become longer,why?

Parents
  • Hi

    As RK said the SoftDevice ADC has priority and might delay your ADC handler. I'm afraid that sampling at 5 kHz while running a Softdevice concurrently might be impossible. You can look into the nRF52 though. It has an ADC with easyDMA features and together with some clever use of timers and PPI channels it should be possible to run a Softdevice while at the same time sample at high speed, store the samples in a buffer, and then read out the samples when your processor is available.

    EDIT: SoftDevice has priority, not ADC.

Reply
  • Hi

    As RK said the SoftDevice ADC has priority and might delay your ADC handler. I'm afraid that sampling at 5 kHz while running a Softdevice concurrently might be impossible. You can look into the nRF52 though. It has an ADC with easyDMA features and together with some clever use of timers and PPI channels it should be possible to run a Softdevice while at the same time sample at high speed, store the samples in a buffer, and then read out the samples when your processor is available.

    EDIT: SoftDevice has priority, not ADC.

Children
Related