Dear all,
I'm working on a msp430f6638. After the initialization I enter in an endless loop where I stop the XT2 clock (= Source of dco/fll, DCOCLKDIV -->MClk) (reason: save power) and then enter into LPM3 mode. A timer (sourced by AClk (timer clock source: XT1)) then generates interrupts from time to time, where I leave lpm3. After executing the ISR, I restart the XT2 clock and then execute code before again XT2 is stopped.
All this works as expected as long as I work with the MSP-FET430UIF module and run button in ccs, but current consumption then is about 270uA in stand by (According to the literature the controller never enters in lpm3 when working with active JTAG)
Therefore I liked to run the code with the free run button in ccs. The standby current is now some microamps (as expected), but the controller never come back to active mode.
When I comment out the stop instruction for XT2, the code works correctly (with free run, but then I do not save power). Therefore I guess that the clock module does not restart correctly (in the initialization it does).
Enter in LPM3 is done as follows:
UCSCTL6 |= XT2OFF;
__bis_SR_register(LPM3_bits + GIE);
And in the ISR routine I leave with:
_low_power_mode_off_on_exit();
Has anyone an idea?
Addendum: I have recognised that the XT1LFOFFG Flag is set, if working with the free run button (with run, the flag staysat zero). That means that there is a problem with the XT1clock, which sources my interrupt timer... Any idea for this strange behaviour? Why should XT1 not work anymore, when entering LPM3?