I would like to add a quadrature encoder to choose the patch and a serial LCD to show the patch name. No problems on the hardware point of view, but I would like to know where I can hook the code for reading the encoder status and send the serial data.
I don’t think an interrupt is required, a human can’t be so fast in turning the control, but if required I would use it.
I’m more worried about the LCD, since if I send the serial data waiting for response in blocking mode the audio routine would get too much delay unless the LCD controller is running at a lower level.
The audio routine is running in some interrupt or in the main code?
This reply was modified 2 years, 7 months ago by Sbob.
The way the code work, there’s a ‘main’ loop which sits and waits until a block of audio is ready. When the audio block interrupt comes in, it unblocks the patch which then processes the samples. It’s double buffered, so that one half of the buffer is filled by DMA while the other is processed.
You could try to do something similar with the LCD, but it may be quite difficult to synchronise the two blocks. How long does it take to send a screen update?
For SPI and I2C communication, you basically have three options: blocking send/receive, interrupt driven, or DMA. DMA is the hardest to configure but means the update can run in parallel with everything else with no load on the CPU.