Best Practices - STM32H7 EXTI Interrupts

I tried to find the answer to this question else where with no luck.

I assume there must be a reason that on gate_in is read via polling instead of an interrupt?

I’ve made many a CV/Gate sequencer on STM32G0 chips, but never one that also uses DSP.

I can get flawless timing way up into the audio range by setting an interrupt that triggers on the falling edge of a clock.

Is there a reason I should avoid this on the daisy? My interrupt routine is lean and just changes a volatile bool to true.

Looks like STM32H7 has more advanced interrupt routines available compared to STM32G0

There’s no problem with using EXTI per se, it was probably not considered something that improves things that much compared to polling, but requires more complicated code to handle them and is not available for every pin. Mutable instruments code also doesn’t use them for similar reasons.

It’s not as simple as that when SAI is involved, because now you would have to synchronize audio processing to EXTI if you actually want to handle events more frequently than once per audio block size. I.e. you would have to track number of bytes transferred by DMA when the interrupt arrives. Or consider that the event could happen several times while you were processing a single block of audio.

1 Like

“so it’s better to actually reproduce the problem before trying to solve it.”

I saw your wise advice above on another thread and I realized that I too created a problem that may not even exist. It is hard abandon a method that “just works” for years, but I can see why that could cause problems.

I have been mostly in the analog world and recently realized that digital oscillators really do sound just as good as analog (when used in “normal” situations)

I’ll post back with my results from trying both methods eventually.

Thank you for taking the time to respond! :owl:

1 Like