This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Timer PWM on LM4F232

Hello,

I am new to the TI ARM and stellarisware family.  I am playing with a LM4F232 dev kit.  My question is regarding PWM using a timer, rather than the dedicated PWM generator block.  Basic PWM needed, nothing fancy.  I am trying to use the wide timer on pin 19-PH3.  I haven't had any luck.  

10kHz - 50%

 

SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER5);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
GPIOPinConfigure(GPIO_PH3_WT5CCP1);
GPIOPinTypeTimer(GPIO_PORTH_BASE, GPIO_PIN_3);
TimerConfigure(WTIMER5_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PWM);
TimerLoadSet(WTIMER5_BASE, TIMER_B, 1600);
TimerMatchSet(WTIMER5_BASE, TIMER_B, TimerLoadGet(WTIMER5_BASE, TIMER_B)/2);
TimerEnable(WTIMER5_BASE, TIMER_B);

while(1){

}

What am I missing?  

Also, when debugging.  I get a No source available for "_c_int00() at 0x764" when I pause.  I realize that it is some kind of reset handler in the startup_ccs.c file, but why am I getting this error?  

Thanks

  • here's code for a similar LX4F - known good - runs @ 50KHz w/ 50% Duty Cycle.  Outputs on PF4 - and is not a "wide timer."  Note: our SysClock is @50MHz.

    void
    timer_set_up(void)
    {
     
      SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
     
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

      HWREG(GPIO_PORTF_BASE + GPIO_O_DR8R) |= 0x10;   //   attempts to provide maximum output drive...

      GPIOPinConfigure(GPIO_PF4_T2CCP0);

      GPIOPinTypeTimer(GPIO_PORTF_BASE, GPIO_PIN_4);
     
      TimerConfigure(TIMER2_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM);
     
      TimerLoadSet(TIMER2_BASE,TIMER_A, 1000);

      TimerMatchSet(TIMER2_BASE,TIMER_A, 500); // 50KHz   50% Duty
      
      TimerEnable(TIMER2_BASE, TIMER_A);
     
    }