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

How to sample an accelerometer at high rate with minimal cpu usage

To reduce power, I'm trying to find the best approach to minimize the cpu load when sampling an accelerometer at a high rate, e.g. 1.6Khz. Is there a way to DMA a sensors fifo buffer/output registers into ram ? Either with the nRF51 or nRF52. Any other alternatives for reduced cpu usage ?

So far all I've come up with is : in order to fetch a predetermined number of samples, M, wait for an N sample fifo buffer on the sensor to almost fill up, then periodically (timer or event based), read the fifo before the fifo fills up and starts to overwrite and loose data. Repeat until you get M samples. This helps (the bigger the fifo the better), but less or no cpu involvement would be ideal.

Somewhat related is the effect of the softdevice. Assume either no connection, or a connection exists and no/minimal data packets are being sent or received on the ble connection (sampling the sensor and concurrently sending/receiving data is not required).

Thanks

Related