For my application I need a mcu with fixed interrupt latency (zero
interrupt jitter). The latency may be arbitrarily high but the jitter
must be zero. Do you know any mcu for that?
Even if you got a CPU with completely deterministic interrupt latency other things will break your timing. That is to say, deterministic interrupt latency won't by itself guarantee that your interrupt code runs with fixed timing.
- If you are running interrupts its likely that you will have other pieces of code that will need to be interrupt-safe. For example writing or reading a data structure that requires more than one read/write instruction. Safely accessing such structures usually involves defining "critical sections" where you briefly disable interrupts to do something atomically and then re-enable them. If your interrupt occurs while a critical section is executing then you just created non-deterministic interrupt latency.
- If the CPU instructions within your interrupt routine don't have deterministic timing then you will have timing jitter regardless of if the interrupt latency is fixed. This can happen for example if you use a cache. If the instructions/data were/weren't in the cache when the interrupt began then the timing can change.
- If there is any peripherals that share access to the memory bus, then your instruction timing can change. For example if a DMA transfer is running when the interrupt occurs then there your interrupt code may run slower than if a DMA transfer wasn't happening when the interrupt occurred.
So to sum up, if you want completely deterministic timing you can't have any critical sections which disable interrupts. Data structures shared with the interrupt code must be lock free. All code and data used by the interrupt must always permanently be either locked in or out of the cache. And you can't use any DMA or other peripherals that can stall the processor's access to memory.
So if you need very stable timing the solution is to put that timing critical processing into some sort of dedicated hardware that's doing nothing else. This could be...
- A capture-compare peripheral (present in may MCUs)
- A small auxiliary microcontroller running code that just captures your signal.
- An FPGA
- A special chip or circuit.
You can also look at something like the ZYNQ SoC made by Xilinx. The ZYNQ combines either 1 or two ARM Cortex A9 processor cores and FPGA fabric in one chip. Its possible to configure a small part of the FPGA fabric into a specialized circuit that will capture your signal with accuracy down to 1 clock cycle.
If you want both high speed and cycle accurate timing then FPGAs are a good option.