Ttelmah Guest
|
|
Posted: Fri Feb 20, 2009 10:30 am |
|
|
Most of the stuff, is common to any chip with the ECCP.
So setup for example, as:
Code: | setup_timer_2(T2_DIV_BY_16,207,1);
setup_ccp1(CCP_PWM_HALF_BRIDGE|CCP_SHUTDOWN_AC_L|CCP_SHUTDOWN_BD_L|CCP_PWM_H_H);
set_pwm1_duty(416L); //Should be 50% duty cycle
|
Gives half bridge operation, with 50:50 mark space.
However the one thing that seems to be missing from the compilers I have tried, is the dead time configuration. I just set this directly, with:
Code: | #byte PWM1CON = 0xFB7
PWM1CON=0x81; |
For one cycle of deadband delay.
You are not alone in controlling this chip, but the other people have just looked at examples for other ECCP's, and the listing file, and then set whatever else they need by going DIY.
It'd 'help' if you said what you actually want to configure the PWM to do?.
Best Wishes |
|