AnsweredAssumed Answered

Aducrf101 PWM

Question asked by Yami on Nov 15, 2012
Latest reply on Nov 19, 2012 by Yami

Hi,

 

I want to use the PWM0 like a analog output (with a filter after the microprocessor output), but I can't get it to work. At this moment I am using this example code; someone can give me a clue? I can't find any examples of a PWM working fine.

 

void output (void){

    //Config P0.4 like PWM0

    pADI_GP4->GPCON|=GP4CON_CON0_PWM0;

   

    pADI_PWM->PWM0LEN=0x1F4;

    pADI_PWM->PWM0COM1|=PWMCON1_CONVSTARTEN_EN|PWMCON1_TRIPEN_EN|PWMCON1_CONVSTARTDELAY_MSK;   

    pADI_PWM->PWMCON0|= PWMCON0_SYNC_DIS|PWMCON0_ENA_EN|PWMCON0_PWMIEN_DIS|

                                          PWMCON0_PWMCP_UCLKDIV64|PWMCON0_POINV_DIS|PWMCON0_HOFF_DIS|

                                          PWMCON0_LCOMP_DIS|PWMCON0_DIR_EN|PWMCON0_HMODE_DIS;   

}

 

Thanks

Outcomes