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 CCS Technical Support

dspic33fj128mc802 MotorPWM module

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



Joined: 30 Nov 2011
Posts: 6

View user's profile Send private message

dspic33fj128mc802 MotorPWM module
PostPosted: Fri Dec 16, 2011 3:35 am     Reply with quote

Hello,

i´m trying to make function the motor control PWM module and i have no answer from my dspic33fj128mc802.

Code:
   setup_motor_pwm(2,MPWM_FREE_RUN | MPWM_SINGLE_PULSE, 1000); 
   set_motor_unit( 2,MPWM_INDEPENDENT , MPWM_FORCE_L_1,MPWM_FAULT_NO_CHANGE,0);
   set_motor_pwm_duty(2,0,0xfff); 
   set_motor_pwm_event(2,1000);



The compiler does it right, but in the pins there are no answer. can anybody help?

And finally, I don´t understand the functions (setup_motor_pwm(), set_motor_unit(), etc) well, so if anybody has experience in it, please explain as you can.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 16, 2011 3:42 pm     Reply with quote

Do a search for setup_motor_pwm in the forum's search page:
http://www.ccsinfo.com/forum/search.php
There are some previous threads on this topic.
Always post your compiler version.
Marqueses



Joined: 30 Nov 2011
Posts: 6

View user's profile Send private message

PostPosted: Tue Dec 20, 2011 4:23 am     Reply with quote

That´s it, i found the solution!. The sample code from the manual is wrong, so don´t read it if you want to make it run. The parameters are bad written.

An example code that works is

Code:
setup_motor_pwm(1,MPWM_FREE_RUN , 10000); 
   set_motor_unit( 1,1,MPWM_INDEPENDENT | MPWM_ENABLE | MPWM_FORCE_L_1,0,0);
   set_motor_pwm_duty(1,1,1000); 


Thanks.
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