CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

A problem with PIC18F4431

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chibi41



Joined: 16 Apr 2012
Posts: 12

View user's profile Send private message

A problem with PIC18F4431
PostPosted: Fri Apr 20, 2012 9:14 am     Reply with quote

hi,

I am using pic18f4431 to drive 3-phase inverter. Before this i try to generate just an ordinary pwm signals by using this code below and it works very well :
Code:

void main()
{

setup_power_pwm_pins(PWM_BOTH_ON, PWM_BOTH_ON, PWM_BOTH_ON, PWM_BOTH_ON);


setup_power_pwm(PWM_CLOCK_DIV_4|PWM_FREE_RUN, 1, 0, 4000, 0, 1,0);

set_power_pwm0_duty(4000);
set_power_pwm2_duty(4000);
set_power_pwm4_duty(4000);
set_power_pwm6_duty(4000);

while(1);
}

However, from datasheet, it said that we need to use pwm override in order to get the sequence between the pulse. Hence i modified my coding as follows but it doesn't work. The signal displayed is still the same as earlier.

Code:

void main()
{
setup_power_pwm_pins(PWM_BOTH_ON, PWM_BOTH_ON, PWM_BOTH_ON, PWM_BOTH_ON);

set_power_pwm_override(0,false,1);
set_power_pwm_override(1,false,1);
set_power_pwm_override(2,false,1);
set_power_pwm_override(3,false,1);
set_power_pwm_override(4,false,1);
set_power_pwm_override(5,false,1);

setup_power_pwm(PWM_CLOCK_DIV_4|PWM_FREE_RUN, 1, 0, 4000, 0, 1,0);

set_power_pwm0_duty(4000);
set_power_pwm2_duty(4000);
set_power_pwm4_duty(4000);
set_power_pwm6_duty(4000);

while(1);
}


Anyone who is expert, I am very grateful for your helping.. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group