Kyle Stewart

I am working with a MCF5213 on the M5211DEMO board. I am...

Discussion created by Kyle Stewart on Oct 11, 2007
Latest reply on Oct 11, 2007 by Kyle Stewart
I am working with a MCF5213 on the M5211DEMO board. I am trying to get PWM working on the PWM1 (pin40) output. I have looked over every piece of sample code I can find on the internet or in these forums. Below is the code I am using right now and it is giving me no output. I don't understand what I am missing. Anyone have ideas?
Thanks

Code:
 // Set data direction for pins MCF_GPIO_DDRTD = 0  | MCF_GPIO_DDRTD_DDRTD0; // Configure pins for PWM use MCF_GPIO_PTDPAR = 0  | MCF_GPIO_PTDPAR_PTDPAR0 // PWM1  | MCF_GPIO_PTDPAR_PTDPAR1  | MCF_GPIO_PTDPAR_PTDPAR2  | MCF_GPIO_PTDPAR_PTDPAR3;   // Setup PWM clock source // settings determined by PWMparametercalculator.xls // and are based on fsys/2 = 40000000  // Use clock source SA MCF_PWM_PWMCLK = 0 | MCF_PWM_PWMCLK_PCLK1;  // Set the prescale value to 1 //MCF_PWM_PWMPRCLK = MCF_PWM_PWMPRCLK_PCKA(1); MCF_PWM_PWMPRCLK = 0; // 2^0 = 1  // Divide the prescale by 200 MCF_PWM_PWMSCLA = 200;  // Set channel polarity to start high, end low MCF_PWM_PWMPOL = 0xFF; // set all PWM to this polarity  // Set channel alignment to left MCF_PWM_PWMCAE = 0x0; // set all PWM to left aligned ////// TONE AND VOLUME SETTINGS /////////////////// // Set PWM period MCF_PWM_PWMPER1 = 200; // start at 500Hz waveform  // Set duty cycle MCF_PWM_PWMDTY1 = 50; // start at 50% duty cycle /////////////////////////////////////////////////// // Enable PWM1 to start tone MCF_PWM_PWME = 0 | MCF_PWM_PWME_PWME1;

 

Outcomes