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

How I generate Motor PWM signal using dsPIC30F4011?

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



Joined: 05 Feb 2010
Posts: 2
Location: TURKEY

View user's profile Send private message

How I generate Motor PWM signal using dsPIC30F4011?
PostPosted: Thu Jul 15, 2010 7:31 am     Reply with quote

Hi all!

Can anybody help me to generate PWM signal using dsPIC30f4011 microcontroller...

I tried function those in the header file of 30F4011.h ....

What must I do to do???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 15, 2010 12:42 pm     Reply with quote

Use the forum's search page. Search for this:
Quote:

dsPIC* motor

Set it to: Search for All Terms

There are many hits. Look at some with sample code:
http://www.ccsinfo.com/forum/viewtopic.php?t=42105
http://www.ccsinfo.com/forum/viewtopic.php?t=37246

I don't have the PCD compiler so I can't give any more help than this.
pwlpc2



Joined: 05 Feb 2010
Posts: 2
Location: TURKEY

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 6:12 am     Reply with quote

Fistly Thanks My Brother...


Secondly I use CCS PCWHD version 4.084...

compiler does not give an error and produce a hex code...

I put in to hex code... there is no PWM pulse...

What can I do????

My Code is here...


Code:

#include <30f4011.h>
#device ADC=10
#fuses XT_PLL16,NOWDT,NOPROTECT
#use delay(clock=7372800)


void main() {

 set_tris_e(0b000000000);
 output_e(0b000000000);
 

setup_timer2(TMR_EXTERNAL|TMR_DIV_BY_1);


//setup_timer4(TMR_32_BIT); //use get_timer45() to get the timer value



//setup_motor_pwm(pwm,options, timebase);
//setup_motor_pwm(pwm,options,prescale,postscale,timebase)

setup_motor_pwm(0,MPWM_FREE_RUN, 255);
set_motor_pwm_duty(0,1,10);


setup_motor_pwm(1,MPWM_FREE_RUN, 255);
set_motor_pwm_duty(1,1,55);

setup_motor_pwm(2,MPWM_FREE_RUN, 255);
set_motor_pwm_duty(2,1,180);






while(1)
{

} //while


} //main
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