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

Ringbuffer SPI/TWI TX with fixed Sample Rate

The Problem ist the continuous sending of Byte-Arrays with spi and fixed sample rate. Strategie:

  • Send Array-List with XFER triggered by Timer (every 3ms) and auto increment
  • another timer counts the single transfers and stops after array end is reached

Problem: With Softdevice there is an interrupt latency of 200µs max. For sound i need to send big Data to a DAC.

Idea1: ring buffer. but i am not able to Reset Pointer of array list with PPI (XFER) isnt it?.

Idea: Double Buffering. Problem: I need an interrupt to start new XFER. worst case: Interrupt is delayed by softdevice -> Sound distotion