Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

msp430fr2311 PWM

$
0
0

Has anyone played around with the new msp430fr2311 launchpad? It seems like the PWM output doesn't work for this one, anyone experiencing similar issues?

 

I'm using the green LED (P2_0 - connected to TB1.1)

 

This is my main in code composer:

 

void main(void)
{
    //Stop WDT
    WDT_A_hold(WDT_A_BASE);
 
    //Set P1.2 to output direction
    GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN2);
    GPIO_setAsOutputPin(GPIO_PORT_P2,GPIO_PIN0);
    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2,GPIO_PIN0,GPIO_PRIMARY_MODULE_FUNCTION);
 
    PMM_unlockLPM5();
 
    initClock();
 
    // Enable global interrupt
    __bis_SR_register(GIE);
 
    checkClock();
 
    Timer_B_outputPWMParam param = {0};
    param.clockSource = TIMER_B_CLOCKSOURCE_SMCLK;
    param.clockSourceDivider = TIMER_B_CLOCKSOURCE_DIVIDER_1;
    param.timerPeriod = 600;
    param.compareRegister = TIMER_B_CAPTURECOMPARE_REGISTER_1;
    param.compareOutputMode = TIMER_B_OUTPUTMODE_RESET_SET;
    param.dutyCycle = 200;
    Timer_B_outputPWM(TIMER_B1_BASE, &param);
 
    while(1);
}

Viewing all articles
Browse latest Browse all 2077

Trending Articles