Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hello everyone, I hope and you are so kind to help me with a question.
I was testing with the MSP432p401r, I set the DCO source and MCLK and SMCLK signals to a frequency of 48MHz. After setting it up I used only one XOR instruction within a while loop, hoping to get a 24MHZ frequency as a result, however , the frequency I get is 1 MHz.
I observed through the P4.3 and P7.0 pins (configured in their primary function) the MCLK and SMLK signals, and they are effectively 48 MHZ.
My question is:
Why if the DCO clock source is set to 48 MHz, and the MCLK and SMCLK signals are powered by the DCO source, without pre-scaler, does the program execute a single XOR instruction at 1 MHZ?
thanks: D
My code:
#include "msp.h"
#include "driverlib.h"
void main(void)
{
MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
MAP_PCM_setPowerState(PCM_AM_LDO_VCORE1);
MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);
MAP_CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1);
MAP_CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1);
MAP_CS_enableClockRequest(CS_MCLK);
MAP_CS_enableClockRequest(CS_SMCLK);
WDTCTL = WDTPW | WDTHOLD;
P4DIR |= BIT3;
P4OUT &= ~BIT3;
P4SEL0 |= BIT3;
P4SEL1 &= ~BIT3;
P7DIR |= BIT0;
P7OUT &= ~BIT0;
P7SEL0 |= BIT0;
P7SEL1 &= ~BIT0;
P1DIR |= BIT0;
while(1){
P1OUT ^=BIT0;
}
}

