Adding extra control

Hi,

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.

Do you have any suggestion?

Hello,

If you want the code to run once every time an audio block has been processed then hook it up with ProgramManager::programReady(), in ProgramManager.cpp

For the encoder, are you planning to use a hardware TIM timer/interrupt?

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?

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.

Very interesting discussion, which I’ll continue to follow.
I’m also interested in extending the peripheral set to include things like multiple CV outs via a multi-channel DAC.

We’re making the Expander which will add 16 ports, configurable as either inputs or outputs :slight_smile:

I’ll look forward to that. I’m also interested in implemented special-purpose panels for targeted control of particular categories of application.

Sbob, would you mind showing us how you did it - when you succeeded adding the encoder and display?
Thanx much!