pwlpc2
Joined: 05 Feb 2010 Posts: 2 Location: TURKEY
|
|
Posted: Fri Jul 16, 2010 6:12 am |
|
|
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 |
|
|