How to sample the SAADC at 200Khz?

We are porting to the nrf52832 an application that needs to sample the SAADC continuously at 200Khz (alternating between two inputs) with dual buffering DMA of let's say 1k samples each and having each completed buffer processed by a computation logic that tracks the state of an external process. The tracked state is then reported externally at a slow rate via BLE.  

Our questions are about the 200Khz dual buffering saadc sampling. We assume that the zephyr saadc driver can't handle this rate (?) so plan to implement something of our own, either a zephyr driver or possibly a simple implementation that bypasses the zephyr driver model. 

 

1. Can the nrf52832 handle this sampling rate or are we facing a dead end?

2. Is there an example of a fast continuous dual buffering saadc  sampling that uses a known time base (5us in our case) and doesn't require CPU attention until a buffer is filled?

3. Can this approach be compatible with zephyr?  (It's ok if the saadc sampling will bypass the zephyr driver model, portability across MCUs is not an issue for us).

4. Anything else we should be aware of?


Thanks.

Parents
  • Thanks Amanda, this is very useful, especially the errata.

    Let's see if we go it right. What we need to do requires scan mode (alternate samples between two inputs), ppi (for proper DMA double buffering) and tAcq should be at least 10us (I presume this is the next step after 5us) which results at a sampling speed of   1s/(10us + 2us) =  83Khz or 41Khz for each of the two scanned inputs. This is less than half of the expected 200khz.

    Is it so?

  • Hi, 

    Yes, if everything should go through PPI, that would be the maximum. You may get away with lower Tacq if you have large enough buffers and can guarantee that you will not be interrupted by something else, and can trigger the START task from the application. The buffer pointer can be changed and TASKS_START can be triggered as soon as the EVENTS_STARTED is generated. May need some thorough testing though. 

    -Amanda

Reply
  • Hi, 

    Yes, if everything should go through PPI, that would be the maximum. You may get away with lower Tacq if you have large enough buffers and can guarantee that you will not be interrupted by something else, and can trigger the START task from the application. The buffer pointer can be changed and TASKS_START can be triggered as soon as the EVENTS_STARTED is generated. May need some thorough testing though. 

    -Amanda

Children
No Data
Related