faisal wrote:Wow, that's a fantastic amount of data.
yes, we're pushing the F427 pretty hard
Do you have 2 interrupts, one at 8k and the other at 1k - and in each interrupt you perform spi polled exchanges? Do you use DMA?
We do use DMA for all SPI transfers. We also use the device FIFOs though, and for the IMUs running at 8kHz sample rate we read multiple samples at once. We just need to make sure we read fast enough to ensure the FIFO doesn't overflow (exact FIFO depth varies between IMU submodels, but typical depth is at least 20 samples).
I'm guessing the DMA interrupt overhead may not be worth it for dozens of bytes of data.
It is well worth it to use the DMA, especially when reading multiple samples at once. An SPI transfer of 14 bytes at 8MHz takes around 16usec, whereas the interrupt costs a fraction of a microsecond.
I'm working on something similar and was wondering what would be the most efficient approach - I figure you must have figured that out already
we've found that "thread per bus" works really well as model for ArduPilot.
Also note that we run the system clock at 1MHz in tickless mode.