I am struggling to wake-up from LPM1 with ADC12_B running on MODOSC. The code sample is in Mecrisp Forth but self explanitory.
Set IRQ to wake-up:
['] wakeup irq-adc ! \ # irq
Set CPU to use MODOSC (to preserve power)
$A5 1 $160 + c! \ KEY CSCTL0_H \ unlock CS $24 4 $160 + c! \ SELS2 SELM4 CSCTL2_L \ SMCLK-LFMODCLK MCLK-MODCLK $FF 1 $160 + c! \ LOCK CSCTL0_H
Set up and start ADC12_B:
$00 $00 $01B0 + ! \ REFVSEL_1.2V REFCTL $02C2 $02 $0800 + ! \ ADC12SHP ADC12DIV6 ADC12SSEL0 ADC12CONSEQ1 \ ADC12CTL1 $0021 $04 $0800 + ! \ ADC12RES2 ADC12PWRMD ADC12CTL2 $00C7 $06 $0800 + ! \ ADC12TCMAP ADC12BATMAP ADC12STARTADD07 \ ADC12CTL3 < 1 MHz $011E $2E $0800 + ! \ ADC12VRSEL1 ADC12INCH1E ADC12MCTL7 $019F $30 $0800 + ! \ ADC12VRSEL1 ADC12EOS ADC12INCH1E ADC12MCTL8 $0390 $00 $0800 + ! \ ADC12SHT03 ADC12MSC ADC12ON ADC12CTL0 \ clear flags $0000 $0C $0800 + ! \ ADC12IFG0 clear $0000 $18 $0800 + ! \ ADC12IV reset $0100 $12 $0800 + ! \ ADC12IER0 enable eint $0C $0800 + @ hex. \ ADC12IFG0 print $0003 $00 $0800 + bis! \ ADC12CTL0 start ADC \ begin pause $01 $0D $0800 + cbit@ until \ ADC12IFGR0_H done? lpm1 \ enter lpm1 only adc running on \ led debug
I can confirm that it does not exit from lpm1. If I use a normal delay loop and wait for the flag it works fine. (commented code)
Is there a known issue with MODCLK stopping in lpm1?