I would like to know what determine witch match register is used for cycle lenght in the PWM function.
In the user manual chap. "12.7.12 PWM Control Register (PWMC)" it says:
"The timer is reset by the match register that is configured to set the PWM cycle length."
How is a match register configured to set the PWM cycle lenght?
Best regards
Jesper M. Madsen
Solved! Go to Solution.
Hi, Jesper,
Regarding your question, any match register can control the cycle length of PWM signal for the CTimer, pls refer to the 18.7.6 Match Control Register (TMR16B0MCR and TMR16B1MCR) in UM10398.pdf, for example, if the MR0S bit is set in the TMR16B0MCR register, when the counter reaches the match0 register TMR16B0MR0, the counter will reset to zero and begins a new PWM cycle, in the case, all the other match register TMR16B0MR1/2/3 must be less than the value of TMR16B0MR0 so that the PWM signal can not be always LOW. In the case, TMR16B0MR0 determines the PWM cycle time.
For example, if the MR1S bit is set in the TMR16B0MCR register, when the counter reaches the match1 register TMR16B0MR1, the counter will reset to zero and begins a new PWM cycle, in the case, all the other match register TMR16B0MR0/2/3 must be less than the value of TMR16B0MR1. In the case, TMR16B0MR1 determines the PWM cycle time.
Hope it can help you
BR
XiangJun Rong
Hi, Jesper,
Regarding your question, any match register can control the cycle length of PWM signal for the CTimer, pls refer to the 18.7.6 Match Control Register (TMR16B0MCR and TMR16B1MCR) in UM10398.pdf, for example, if the MR0S bit is set in the TMR16B0MCR register, when the counter reaches the match0 register TMR16B0MR0, the counter will reset to zero and begins a new PWM cycle, in the case, all the other match register TMR16B0MR1/2/3 must be less than the value of TMR16B0MR0 so that the PWM signal can not be always LOW. In the case, TMR16B0MR0 determines the PWM cycle time.
For example, if the MR1S bit is set in the TMR16B0MCR register, when the counter reaches the match1 register TMR16B0MR1, the counter will reset to zero and begins a new PWM cycle, in the case, all the other match register TMR16B0MR0/2/3 must be less than the value of TMR16B0MR1. In the case, TMR16B0MR1 determines the PWM cycle time.
Hope it can help you
BR
XiangJun Rong
I see.. Thanks a lot..