Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSPDRIVERLIB
Tool/software: Code Composer Studio
I get the following output (as expected) when I set the clocks using the attached code.
Configuring clocks ...
Verifying clocks ...
MCLK_Frequency: 8000000
SMCLK_Frequency: 8000000
If I use the commented "CS_initClockSignal" line instead of the one following it I get the following output.
Configuring clocks ...
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.
I expected to get the following output.
Configuring clocks ...
Verifying clocks ...
MCLK_Frequency: 16000000
SMCLK_Frequency: 8000000
The code works properly when I run it in a different program but does not work properly in this program. Any help would be appreciated.
#include <msp430.h>
#include "driverlib.h"
#include "gpio.h"
#include "stdio.h"
#include "string.h"
int main(void)
{
WDT_A_hold(WDT_A_BASE); // Stop watchdog timer
// Configure and verify clocks.
// ********** Cannot use CS_CLOCK_DIVIDER_1 for some reason for MCLK - works in another program though ********
printf("Configuring clocks ... \n");
CS_setDCOFreq(CS_DCORSEL_1,CS_DCOFSEL_4); // 16 MHz
CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_2); // 8 MHz
// CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1); // 16 MHz
CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_2); // 8 MHz
CS_turnOnSMCLK();
printf("Verifying clocks ... \n");
uint32_t MCLK_Frequency;
uint32_t SMCLK_Frequency;
MCLK_Frequency = CS_getMCLK();
SMCLK_Frequency = CS_getSMCLK();
printf("MCLK_Frequency: %ld \n",MCLK_Frequency);
printf("SMCLK_Frequency: %ld \n",SMCLK_Frequency);
while(1) {;}
}
