Yes, there is no problem to change the period and compare value in the TC interrupt handler.
I think you should describe which function you want to achieve.
Could you offer us more information to decide whether it could be achieve.
Thank you very much for your reply.
About first question, I am concerned about making a misjudgment when the comparison with the counter value occurs at the moment of writing the period and compare value.
Do you still think there is no problem?
This KBA might be helpful:
Basically, in running Timer/Counter or PWM, a new value value will take effect after tc overflow (next period).
In KBA90554 , it is written that the period or compare value is larger or smaller than counter value.
If the period/compare register of the timer/counter(PWM) is asynchronous clocking, the malunction should occur
like "In the case of asynchronous clocking".
If it is synchronous clocking, there is no malfuncion like "In the case of synchronous clocking"
Which type it was made?
The TCPWM runs in the asynchronous clock like you described in the previous response (first figure).
We don't recommend you change the period value and let it act in the current cycle.
You can call the API: void PWM_1_WritePeriodBuf(uint32 periodBuf) to change the period. If you use this way, it will take effect after TC event.
It became clear.
I really appreciate your help.