SPI Master sample rate / DMA to external DACs

using a Jetson Nano board configured to have either 1 or 2 SPI master SPI peripherals, how can I set a fixed sample rate for the SPI writing ?

the reason being we are real-time sampling a signal with an external device connected to a USB port, which is then “processed” to create a number to poke out to a DAC.

the DAC needs to be updated @ 100kSPS with 24 bits being needed to be written on each update.

I am well versed at doing this at a lower level with a micro controller or I2S type peripheral where you can set the sample rate and then essentially poke a buffer to a DMA engine to then write the peripheral on the sample rate time base, feeding in a new buffer either before or at the end of the buffer

looking at the linux examples that open /dev/spixxx devices and IOCTL functions, it only seems to have a concept of setting the word length and the clock speed but nothing else for when you write to it.

are we missing something or is this just something this platform cannot do to make an idealy, real time sampling and outputting system?

Did you check the spidev_test.c for the sample to read/write/configure speed?

you miss the point, i need to control the rate between bursts of 3 bytes at a time, not how fast the clock is and hence how fast an entire burst of bytes wil lbe

Sorry, I still don’t understand your request. Have you run successfully on any of others none tegra platform?

think of it like the i2s port to a codec : i want to throw samples at a DAC as a burst ( a block of say 100 “samples” ) but have it only clock out 3 bytes [ how the SPI peripheral is configured ] every 10us for instance but with a 50MHz clock which would only take about 500ns

even if the data is actually packed in 32 bit chunks rather than 24 to satisfy the SPI peripheral, that doesn’t matter, it’s more the point that the transfer of say 3 or 4 hundered bytes should not be flat out as you would to a display for instance but internally DMA’d to the SPI peripheral on a timer basis as normal / proper micro controllers can do