Hi Michel Hayoz
I think it is possible to initiate the SPI transfer with an ISR.
Yes, the ADC driver of MQX is not able to sample at high frequency, as you said, the minimum sampling period is 5 ms because this is the TICK timer period of the RTOS. Therefore, in order to have a high sampling rate, it will be required to add a "bare-board" ADC driver inside MQX RTOS, and bypassing the ADC interrupt from MQX for using the "bare-board" interrupt.
If you want that MQX handle all the ISR process you can use _int_install_isr. Using this function MQX catches all hardware interrupts in the range that the BSP defined and saves the context of the active task. For most interrupts, MQX calls the ISR that is stored in the interrupt vector table at the location identified by its interrupt vector number. The disadvantage with this is the interrupt latency is longer and depends completely on MQX.
The other option is using _int_install_kernel_isr. Some real-time applications need special event handling to occur outside the scope of MQX. The need might arise that the latency in servicing an interrupt be less than the MQX interrupt latency. If this is the case, an application can use _int_install_kernel_isr(0 to bypass MQX and let the interrupt be serviced immediately.
A kernle ISR cannot call MQX functions. However, it can put data in global variables, which a task can access.
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button or helpful. Thank you!
-----------------------------------------------------------------------------------------------------------------------