Part Number: MSP432P401R
Tool/software: Code Composer Studio
I want to use HFXTL oscillator to generate the 48MHz out of SMCLK that I am going to use for my I2C clock. I am not sure whether the initialisation routine is correct. Can anybody point out any mistake in following routine. Note that I am not using any low power mode:
void clock_setup(){
CS->KEY = CS_KEY_VAL; //Enter the CS key to unlock the registers
CS->CTL1 = CS_CTL1_SELS__HFXTCLK ; //Select HFXTCLK as source for SMCLK
CS->CTL2 = CS_CTL2_HFXT_EN | CS_CTL2_HFXTFREQ_6 ; //Turns on the HFXT oscillator regardless if used as a clock resource, 40 - 48 MHz clock,
while(!(CS->STAT & CS_STAT_SMCLK_READY)) ; //Wait for SMCLK to be stable
}