View previous topic :: View next topic |
Author |
Message |
messer
Joined: 30 Nov 2010 Posts: 3
|
pwm using dspic30f2010 |
Posted: Tue Nov 30, 2010 9:44 am |
|
|
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
|
Re: pwm using dspic30f2010 |
Posted: Tue Nov 30, 2010 9:58 am |
|
|
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: 19504
|
|
Posted: Tue Nov 30, 2010 9:59 am |
|
|
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
|
|
Posted: Tue Nov 30, 2010 10:12 am |
|
|
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 |
|
|
|