Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to update the duty ratio register and cycle register in PWM mode?

CYCLE duty mode PWM ratio REGISTER
0
10 Posted

How to update the duty ratio register and cycle register in PWM mode?

0
10

In 8/12/16-bit PWM mode, every Timer has corresponding cycle register and duty ratio register with following operations. 1. In 8-bit PWM mode, data should be written first into P_TMRx_PWMDuty, and then P_TMRx_PWMPeriod.(x=0,2,4) 2. In 12-bit PWM mode, when updating cycle, data should be written first into P_TMRx_DutyPeriod, and then P_TMRx_PWMPeriod; when updating duty ratio, data should be written first into P_TMRx_DutyPeriod, and then P_TMRx_PWMDuty.(x=1,3) In 16-bit PWM mode, when updating cycle, data should be written first into P_TMR5_DutyPeriodHi, and then P_TMR5_PWMPeriodLo; when updating duty ratio, data should be written first into P_TMR5_DutyPeriodHi, and then P_TMR5_PWMDutyLo.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123