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.

MSP430FR2355: How to generate PWM?

Part Number: MSP430FR2355


Hi Experts,

A

Asking assistance for this query from Cx:

The code below fails to produce a PWM output on P5.1

 What have I got wrong please?

  /* MSP430FR2355 Setup PWM output on P5.1 which is assigned Timer B2.2 */
 
    P5DIR |= (BIT1);
    P5SEL0 |= (BIT1);
    P5SEL1 &= ~(BIT1);
 
    /*** Timer_B Set-Up ***/
    TB2CCR0 |= 1000;
    TB2CCR1 |= 500;     // 50% duty cycle
    TB2CCTL1 |= OUTMOD_7;
    TBCTL |= TBSSEL_1 + MC_1;
This was wrong, but still no PWM output:
P5SEL0 = 1;
P5SEL1 = 0;

Thank you.

Regards,
Archie A.

**Attention** This is a public forum