When I use s32k142, I encounter the abnormal phenomenon of timer capture, hope someone can help to see the reason, thank you here. Let me describe the problem first.
I first explain the code functions: 1, using timer 0 as PWM output 2, using timer 1 as input capture 3, using timer 2 as timing count, 4 using ADC0 ADC1 channel for ADC acquisition
When I initialized the functions of each module in main, all the functions were running normally, as shown in the configuration figure below.
But when I wrap all the initialization into a function and input a PWM signal to any of the capture pins, the running program crashes.
If I block the timer capture configuration, the program works.
What is the cause of this, why the timer capture configuration function into its own wrapped function will crash phenomenon.I have put the source code above, I hope it can be solved, thank you.
Solved! Go to Solution.
Thank you very much for your reply,BR, Daniel.
After I changed it to a global variable, it worked fine.
Thank you for helping me solve the problem.