This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR5994: ADC12_B Wake-up from LPM1 with MODOSC

Part Number: MSP430FR5994

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?

  • Hello,

    MODOSC should still be available in lpm1. Are you able to see if the code is entering the ADC interrupt routine? If it is, it could be that the lpm1 bits are not being cleared to exit lpm1 after the interrupt ends. If it is not entering the interrupt routine, some more testing would have to be done to narrow down if it's a clock source, interrupt enable, interrupt vector, or something else causing the issue.

    Some tests could include entering lpm0 instead of lpm1 or sourcing MCLK, SMCLK, and the ADC from a different clock.

    Would you be willing to use Code Composer Studio or CCS Cloud? It would have a lot of useful tools for code development and debugging including code examples, driver libraries, and looking at register values during code execution.

    Regards,

    Ryan

  • Hello,

    Were you able to solve your problem or do you have any updates?

    Regards,
    Ryan

**Attention** This is a public forum