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

Sampling SAADC at multiple frequencies.

I am making a BLE device that uses 7 ADC inputs. Most of the inputs need to read at 1hz or so. Two of these inputs are of interest

  • The first is a heart-rate signal that needs to read at 100+hz. I need to have an idea of the time/frequency when it samples so I can compute BPM.
  • The second input needs to read 5-20us after a pin that pulses at 1-255hz (the frequency is chosen via a Bluetooth characteristic). I used this example to get the pwm/saadc working.

I have solved each of these independently of each other, the issue is getting both to work together.

From what I can tell, there can only be one saadc task. This throws a wrench in my plans, I am unsure of how to approach this issue, any ideas?

Parents Reply
  • Hi,

    Yes, you can trigger the same task (sample task in this case) from multiple events via PPI. All channels will still be sampled at the same time then if you use scan mode, but if you have enough time between each sampling you could reconfigure the SAADC between each time so that only the desired channels are samples. Depending on the sampling rates that might not be possible though, if the sampling events drift relative to each other so that they at some point (almost) overlap, not leaving you time to reconfigure the SAADC.

Children
No Data
Related