AnsweredAssumed Answered

PWM on SHARC ADSP-21479

Question asked by col on Jan 13, 2012
Latest reply on Jan 13, 2012 by col

I have the following code which initialize PWM3 on ADSP-21479 (100-LQFP) processor.   The code initializes PWM3 and output PWM3 on DPI pins. I do not need interrupt.  My understanding is that I do not have to program the SRU, instead configure the EPDATA in the SYSCTL register (i.e. presumbly setting EPDATA = 011 to get PWM3 AH, AL, BH, BL outputs to pin DPI11, DPI12, DPI13, and DPI14.)  Unfortunately, I do not see any PWM waveform on these pins and I'm clueless as to why it is not working.  Here is the code:

 

int initPWM(void)
{

*pSYSCTL |= (NODATA | PWM3EN | PWMONDPIEN);   // Data pins are FLAGS/PWM, Enable PWM3, Enable PWM signals on the DPI Pins.

*pPWMPOL3 = PWM_POL0AL | PWM_POL1AH | PWM_POL0BL | PWM_POL1BH;
*pPWMSEG3 = 0;       // Enable PWM output signal, disable A & B crossover.
*pPWMCTL3 = PWM_PAIR;     // PWM left justified, non paired mode, duty cycle values are programmable only once per PWM period, PWM Interrupt not enable.

*pPWMPERIOD3 = 2004;      // f(PWM) = PCLK/2*PWMPERIODx; PCLK = CCLK/2 = 48MHz.  f(PWM) = 11976.0479 for PWMPERIOD1 = 2004; 
*pPWMA3 = 0;        // 50% duty cycle for AH
*pPWMAL3 = 0;
*pPWMB3 = 0;
*pPWMBL3 = 0;
*pPWMDT3 = 0;       // Dead time = 0;

*pPWMGCTL |= (PWM_DIS0 | PWM_SYNCEN0 | PWM_DIS1 | PWM_SYNCEN1 | PWM_DIS2 | PWM_SYNCEN2 | PWM_EN3 | PWM_SYNCEN3);  // Enable PWM1

  
return 1;
}

 

Please advice.

 

Thanks,

 

Loc

Outcomes