Hello,
I m using MSP430F2418 in my design along with TPS61097-33.
most of the time, the MCU in sleep mode. therefore i disable the regulator in sleep mode and enable when it is woken up.
i change operating frequency to 1 MHz before sleeping and set to 16MHz after woken up (after enabling the regulator).
I have noticed that the MCU got stuck when the frequency is changing. I have observed it happens only changing the frequency from 16MHz to 1 MHz.
this is my code used to change the frequency...
-------------------------------------------------------------------------------------------------------------------------
void changeFrequency(uint16 fre){
switch(fre){
case 1:
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
break;
case 8:
BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ;
break;
case 12:
BCSCTL1 = CALBC1_12MHZ;
DCOCTL = CALDCO_12MHZ;
break;
case 16:
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ;
break;
default:
return;
}
uint16 i;
while (IFG1 & OFIFG)
{
// Clear oscillator fault flag
IFG1 &= ~OFIFG;
for (i = 0x4800; i > 0; i--) asm("NOP");
}
runningFrequency = fre;
}
--------------------------------------------------------------------------------------------------------
It is important that i have change the operating frequency in several places because several peripherals draws large current which affects the supply voltage. those places i have reduce the operating frequencies.
Thanking you,
Ushan