Hello
Can anyone help me with setting the pwm4 at pic16f1939. I done as at others micros but is doing only the envelope - during the pwm on it goes to high and if I disable the pwm output goes to low.
Code:
#use delay(int=16000000)
setup_timer_2(T2_DIV_BY_1,104,1); //26.2 us overflow
CCPTMRS0 = 0X00; //set timer 2 for pwm4
setup_ccp4(CCP_PWM);
set_pwm4_duty(210); //for 50%
//setup_ccp4(CCP_OFF);
Thank you.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Wed Aug 24, 2011 11:11 am
Quote:
setup_timer_2(T2_DIV_BY_1,104,1); //26.2 us overflow
CCPTMRS0 = 0X00; //set timer 2 for pwm4
setup_ccp4(CCP_PWM);
set_pwm4_duty(210); //for 50%
During the pwm on it goes to high and if I disable the pwm output goes to low.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum