K33rg4t3
Full Member level 3
Hey
I am using dsPIC30F4011 with 16 MHz crystal.
I am using mikroC for dsPIC.
I have such code:
I have expected it to run PWM on RE0 and RE1 pins (marked as PWM in datasheet):
But the PWM is generated on pin 23 (RD0).
Why? Am I understanding the datasheet wrong? Why the non-PWM pins are PWM?
I am using dsPIC30F4011 with 16 MHz crystal.
I am using mikroC for dsPIC.
I have such code:
Code:
void main() {
int pwm_period1;
int i;
ADPCFG = 0xFFFF;
// initialize PWM 1, using scale 1, and Timer 2....
pwm_period1 = PWM_Init(500 , 1, 1, 2);
PWM_Start(1);
PWM_Set_Duty(0, 1); // set current duty for PWM1
while (1)
{
for(i = 0; i < pwm_period1; i++)
{
Delay_ms(1);
PWM_Set_Duty(i, 1); // set current duty for PWM1
}
}
}
But the PWM is generated on pin 23 (RD0).
Why? Am I understanding the datasheet wrong? Why the non-PWM pins are PWM?