PDA

View Full Version : Enhanced PWM Full-Bridge Mode



Zapman
- 9th September 2022, 17:28
Hello everyone,
I searched all the forum topics on motor control I could find and went through the manual but I am still at a loss for how to use the Enhanced PWM Full-Bridge mode in PBP for a 18F46K80. Does PBP support this mode or do I have to do an assembly routine that gets called from PBP?

Thanks for any help that can be given.

Paul

richard
- 10th September 2022, 01:05
PBP support this mode or do I have to do an assembly routine that gets called from PBP?

its not supported, no need to resort to asm though
simply set the required sfr registers yourself
eg


CCP2CON = %10001100 ;enh pwm complementary output
CCPTMRS = CCPTMRS & %11110011 ;tmr2 for ccp2
T2CON = %00000101
PWM2CON = 10 ;dead time
ccpr2l = 128

Zapman
- 14th September 2022, 19:08
its not supported, no need to resort to asm though
simply set the required sfr registers yourself
eg


CCP2CON = 001100 ;enh pwm complementary output
CCPTMRS = CCPTMRS & 110011 ;tmr2 for ccp2
T2CON = 000101
PWM2CON = 10 ;dead time
ccpr2l = 128


In looking at the code I think the CCP2CON would have to be 01xx1100 for forward or 11xx1100 for reverse. I think that is what I got from the manual.
Thanks again.