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.

MSP430FR2311: MSP430FR2311 lachpad

Part Number: MSP430FR2311

hi every one,

i am trying to run pwm source code in below. But, i cannot see pwm signal to P1.6 port. what is the wrong things?

thankyou for your help,

best regards,

void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop WDT

P1DIR |= BIT7; // P1.1 and P1.7 output
P1SEL0 |= BIT7; // P1.7 options select - TB0.2 output
P1SEL1 &= ~(BIT7); // TB0TRG Trigger



// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;

SYSCFG2 |= TB0TRGSEL__EXTERNAL; //Change TB0 high-impedance trigger to external (P1.2)


// Configure T0.2
TB0CCR0 = 1000-1; // PWM Period
TB0CCTL2 = OUTMOD_7; // CCR2 reset/set
TB0CCR2 = 250; // CCR2 PWM duty cycle
TB0CTL = TBSSEL__SMCLK | MC__UP | TBCLR; // SMCLK, up mode, clear TBR


__enable_interrupt(); //Enable maskable interrupts

__bis_SR_register( GIE);
// __bis_SR_register(LPM0_bits); // Enter LPM0
__no_operation(); // For debugger


do{}while(1);
}

  • 1) You're putting the PWM on P1.7, so be sure to check that pin not P1.6

    2) The convention in the pin function tables [Ref data sheet (SLAE58E) Table 6-43] is that in the PSEL column the first bit refers to PxSEL1, and the second to PxSEL0,  so

    >P1SEL0 |= BIT7; // P1.7 options select - TB0.2 output
    >P1SEL1 &= ~(BIT7); // TB0TRG Trigger

    should be:

    >P1SEL1 |= BIT7; // P1.7 options select - TB0.2 output
    >P1SEL0 &= ~(BIT7); // TB0TRG Trigger

    3) Don't forget to remove the TXD and RXD jumpers from the J101 ("bridge") header

**Attention** This is a public forum