Hi everyone,
I got some troubles with the function: Timer_A_generatePWM(). The code compile well, but my led doesn't light up.
Here is my code:
int main(void)
{
/* Stop Watchdog */
WDT_A_holdTimer();
MAP_SysTick_enableModule();
MAP_SysTick_setPeriod(600000);
MAP_SysTick_enableInterrupt();
MAP_Interrupt_enableMaster();
MAP_SysTick_registerInterrupt(SysTick_isr);
Timer_A_PWMConfig pwmConfig =
{
TIMER_A_CLOCKSOURCE_SMCLK,
TIMER_A_CLOCKSOURCE_DIVIDER_1,
300,
TIMER_A_CAPTURECOMPARE_REGISTER_0,
TIMER_A_OUTPUTMODE_RESET_SET,
150
};
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5, GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
Timer_A_generatePWM(TIMER_A0_MODULE, &pwmConfig);
uint16_t compt = 0;
for(compt = 0; compt < 300; compt++)
{
pwmConfig.dutyCycle = compt;
Timer_A_generatePWM(TIMER_A0_MODULE, &pwmConfig);
delay(20);
}
}
Even the example of driverlib, copied and pasted, doesn't work. the hardware seems to be ok because the pwm works when i have tried it using energia IDE and the function AnalogWrite().
what did i forget ?
I am out of ideas, any help would be welcome.
I thank you in advance.