Hello everyone,
I am trying the in-built High speed PWM module of the dsPIC33EP and I have a few basic questions regarding this module.
1.How is PTPER calculated?
Currently I am using this as my reference
PTPER = (Fosc/(F_pwm*prescaler)) – 1
Is this correct or is there any other formula to use.
[edit] I am reffering to the "-1" which is missing in the high speed pwm manual.[/edit]
2.Regarding setting the duty cycle, Am I right in assuming that the maximum value the MDC register would count is the value in the PTPER register?
For example if PTPER is 5000, then for 50% duty cycle the value in MDC register should be 2500?
3.I am trying to drive an H bridge circuit; I have seen many recommending to use the module in complementary mode. Is this an absolute necessity to use complementary mode when driving an H bridge?
Thanks in advance,
Arun
I am trying the in-built High speed PWM module of the dsPIC33EP and I have a few basic questions regarding this module.
1.How is PTPER calculated?
Currently I am using this as my reference
PTPER = (Fosc/(F_pwm*prescaler)) – 1
Is this correct or is there any other formula to use.
[edit] I am reffering to the "-1" which is missing in the high speed pwm manual.[/edit]
2.Regarding setting the duty cycle, Am I right in assuming that the maximum value the MDC register would count is the value in the PTPER register?
For example if PTPER is 5000, then for 50% duty cycle the value in MDC register should be 2500?
3.I am trying to drive an H bridge circuit; I have seen many recommending to use the module in complementary mode. Is this an absolute necessity to use complementary mode when driving an H bridge?
Thanks in advance,
Arun
Last edited: