Currently I'm working in a project where I'm reading 4 channels in a callback function with priority 5 and also, I configured a timer with a callback function with priority 3 running every 1 second, the adc values are correct but the timer is not working, if a configured the adc callback as NULL the timer works properly .
the timer is used to run other functions, I was debugging and loop variable from timer function is increasing only if the adc callback is configured as NULL is fsp. could you help me ?
Hi Arturo,
Thank you for reaching out to Renesas!
It looks like the ADC callback might be taking too long to execute, which is preventing the higher-priority timer interrupt from running.
Even though the timer has a higher priority, if nested interrupts are not enabled, the lower-priority ADC callback can still prevent the timer ISR from executing if it runs too long. Since the timer works fine when the ADC callback is set to NULL, this confirms the ADC ISR might be occupying too much time.
I recommend keeping the ADC callback as short as possible. Also, enabling nested interrupts can help allow the timer to preempt the ADC callback.
Let me know if you need help.
Kind regards,
PS