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

Parents
  • Hi,

    You are correct, it is not possible to reset the array list pointer using PPI. PPI can only be used to connect a specific EVENT to one, or multiple, TASKS. I'm not aware of any other method you can use than using an interrupt now and then to reset the pointer. It is not possible to change the softdevice behavior, and it will allways have highest priority. Do you not have any buffering time for your data transfers?

    Best regards,

    Jørgen

Reply
  • Hi,

    You are correct, it is not possible to reset the array list pointer using PPI. PPI can only be used to connect a specific EVENT to one, or multiple, TASKS. I'm not aware of any other method you can use than using an interrupt now and then to reset the pointer. It is not possible to change the softdevice behavior, and it will allways have highest priority. Do you not have any buffering time for your data transfers?

    Best regards,

    Jørgen

Children
No Data
Related