Greetings,
Im facing a problem configuring a general purpose timer module for pwm output on pin PF1:
Currently my config funtion looks like this
void
configure_pwm()
{
SYSCTL->RCGCTIMER |= 0x01; //Enable TIMER0 Module
SYSCTL->RCGCGPIO |= 1 << 5; //Clock GPIOF
GPIOF->AFSEL |= 0x02; //Select alternate function on pin PF1
GPIOF->PCTL |= 0x70; //Select T0CCP1 function for pin PF1
TIMER0->CTL &= 0 << 8; //Ensure the timer (Timer B) is disabled before making changes
TIMER0->CFG |= 0x04; //Select the 16 bit timer configuration
TIMER0->TBMR |= 0x0A; //TnAMS = 0x1, TnCMR = 0x0, TnMR field = 0x02
TIMER0->CTL &= 0 <<14; //Timer B output is not inverted
TIMER0->TBPR = 0x007A; //Prescaler value
TIMER0->TBILR = 0x1200; //Load timer start value
TIMER0->TBPMR = 0x003D; //load the prescale match value
TIMER0->TBMATCHR = 0x0900; //load the match value
TIMER0->CTL |= 1 << 8; //Enable timer B PWM generation
}
I must be missing something but i can't find what it is. Maybe you can provide some insight into this matter. System Clock is 80 Mhz.
Thanks in Advance.