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

pwm using dspic30f2010

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



Joined: 30 Nov 2010
Posts: 3

View user's profile Send private message

pwm using dspic30f2010
PostPosted: Tue Nov 30, 2010 9:44 am     Reply with quote

Hi!

I have pcd version 4.088.
I use ex_pwm.c, but here example program is not working. Because not pwm signal for pwm output.

Please send me new version ex_pwm.c.

Thank you
messer



Joined: 30 Nov 2010
Posts: 3

View user's profile Send private message

Re: pwm using dspic30f2010
PostPosted: Tue Nov 30, 2010 9:58 am     Reply with quote

My program:
Code:

#include <30F2010.h>
#fuses HS,NOWDT
#device ADC=10
#use delay(clock=20000000)

void main(void)
{
setup_timer2(TMR_INTERNAL | TMR_DIV_BY_1, 0xFFC0);
setup_compare(1, COMPARE_PWM | COMPARE_TIMER2);
set_pwm_duty(1,200 * (int16)64);

while(1)
  {
   delay_us(10);
   }
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19559

View user's profile Send private message

PostPosted: Tue Nov 30, 2010 9:59 am     Reply with quote

1) Read the header of this Forum. Top right corner sections 2, and 3, in the little box. This is _not_ CCS support.

2) On your chip, you need to add a #pin select statement, to tell the chip what pin to use for the PWM. Do a search here about this.

Best Wishes
messer



Joined: 30 Nov 2010
Posts: 3

View user's profile Send private message

PostPosted: Tue Nov 30, 2010 10:12 am     Reply with quote

Ttelmah wrote:
1) Read the header of this Forum. Top right corner sections 2, and 3, in the little box. This is _not_ CCS support.

2) On your chip, you need to add a #pin select statement, to tell the chip what pin to use for the PWM. Do a search here about this.

Best Wishes


Thank you for your quick answer, but I do not understand. Please correct the line I screwed up.
I write to you to stop, to which the PWM output?

Best Wishes
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