|
|
View previous topic :: View next topic |
Author |
Message |
Marqueses
Joined: 30 Nov 2011 Posts: 6
|
dspic33fj128mc802 MotorPWM module |
Posted: Fri Dec 16, 2011 3:35 am |
|
|
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
|
|
Posted: Fri Dec 16, 2011 3:42 pm |
|
|
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
|
|
Posted: Tue Dec 20, 2011 4:23 am |
|
|
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. |
|
|
|
|
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
|