Hi all, I'm trying to get my head around using SPI in/with interrupts, some background on what I'm trying to do:
I have an SPI DAC that I want to update at a set sample rate, updating at audio rate (around 45KHz) is my end goal. I'm using intervalTimer to update the DAC periodically and this is working fine on it's own, but the issue is that I'm also using a TFT display on the same SPI bus. I can get the two to function together by using the usingInterrupts() function of the SPI library, but any lengthy display update is blocking the update of the DAC and causing glitches in its output.
Does anyone know if it's possible to set the priority of interrupts, so that that an SPI transaction called from the DAC's intervalTimer's ISR can interrupt a display update SPI transaction? My feeling is that even if it were, it might not be possible to cancel an SPI transation, otherwise incomplete data would be latched in, and even if it were, a lengthy display update would never have enough time to complete fully before the next 45KHz DAC update came along?
Anyone's insight to this issue would be greatly appreciated!
I have an SPI DAC that I want to update at a set sample rate, updating at audio rate (around 45KHz) is my end goal. I'm using intervalTimer to update the DAC periodically and this is working fine on it's own, but the issue is that I'm also using a TFT display on the same SPI bus. I can get the two to function together by using the usingInterrupts() function of the SPI library, but any lengthy display update is blocking the update of the DAC and causing glitches in its output.
Does anyone know if it's possible to set the priority of interrupts, so that that an SPI transaction called from the DAC's intervalTimer's ISR can interrupt a display update SPI transaction? My feeling is that even if it were, it might not be possible to cancel an SPI transation, otherwise incomplete data would be latched in, and even if it were, a lengthy display update would never have enough time to complete fully before the next 45KHz DAC update came along?
Anyone's insight to this issue would be greatly appreciated!