MSPM0L1228: ADC demo stuck at while (false == gCheckADC)

Part Number: MSPM0L1228
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi expert,

My customer use LP-MSPMOL1228 and sdk demo 'adc12_single_conversion_vref_internal'. In the debug mode, when he ran the demo, it stuck at ‘while (false == gCheckADC)’. What could be the root cause of this issue? What is the function of below software?

while (false == gCheckADC) {
            __WFE();
        }

  • How do you tell that the program is stuck?

    A 125usec sample time is fairly long, so almost all the run time will be spent in that loop. If you check by pausing the program it will almost certainly stop there.

    Try setting a breakpoint on the line following the while() loop, or maybe on the first line in the ISR (ADC12_0_INST_IRQHandler).

  • Hi Angela,

    If get stuck, it probably doesn't enter the following ADC interrupt function successfully. Customer can set a breakpoint to double check whether it can enter it or not.

    If so, need to check following two points:

    1. Check if enable the corresponding "result loaded interrupt" in the Sysconfig.

    2. Need to enable the ADC Interrupt in the "main" function.

    -----------------------------------------------------------------------------------------------------------------------------------------------

    while (false == gCheckADC) {
        __WFE();
    }

    When execute the "__WFE()", it will enter the default low power mode which you set in the Sysconfig as shown below.

    Best Regards,
    Peter