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.

How to alter GPIO pin's toggle frequency on MSP432

Hi all,

I just got the MSP432 and have been trying to use the 48 MHz clock as the source for which the GPIO pins could toggle on and off as an output, but have been unsuccessful even though the sources show that they are running at 48 MHz. The code I have now to change the clock freqs is:

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

CSKEY = CSKEY_VAL;
CSCTL0 = DCORSEL_5;
CSCTL1 = SELS_3 + SELM_3 + DIVS_0 + DIVM_0;
CSCTL2 = HFXTFREQ_6;
CSKEY = 0;

//Outputs signals from MCLK, SMCLK, and HSMCLK
P7DIR |= BIT0;
P7SEL0 |= BIT0;
P7SEL1 &= ~BIT0;
P4DIR |= BIT3 | BIT4;
P4SEL0 |=BIT3 | BIT4;
P4SEL1 &= ~(BIT3 | BIT4);


P1DIR |= BIT5;

while(1) {   // Want to maximize toggle frequency
P1OUT |= BIT5;
P1OUT &= ~BIT5;
P1OUT |= BIT5;
P1OUT &= ~BIT5;
}

Any thoughts as to how this should be done? I just need these pins to toggle as fast as possible.

Thanks!

**Attention** This is a public forum