MSPM0G3519: ADC12_CTL1_CONSEQ_SEQUENCE example

Part Number: MSPM0G3519


could you provide a code example or description how to start sequence converstion, wait for the result and restart (if needed)?

i'm having unexpected behaviour if  ADC12_CTL1_CONSEQ_SEQUENCE bit is set - same as ADC12_CTL1_CONSEQ_REPEATSEQUENCE is set - the conversion process never ends - the interrupts ADC12_CPU_INT_IIDX_STAT_MEMRESIFGx never stop coming despite i'm expecting only 1 (one) after  DL_ADC12_startConversion call.

thank you in advance.
 
  • Hi Mykhaylo,
    Which project are you using for this error to show up? I think our original single-conversion example should work if you remove the startConversion function from the while(1) loop, or remove the while(1) loop altogether.

    Best Regards,

    Diego Abad

  • Hi Diego, thanks for the reply.

    i'm using it for measuring voltage on a battery. i'm not really getting your answer, yes  - your original example works, unfortunately - i can't easily reuse it on my setup.what's makes me scratching my head is DC_ADC12_enableConversions() call every cycle- why it is necessary - without it the example doesn't work. this means it goes to "disable" state automatically after the conversion finishes. why do we need both "start" and "enable" every conversion cycle?

  • Hi Mykhaylo,
    The reason its due to the ADC not being configured in repeat mode. This can be accomplished by clicking this checkbox.

    After having this option turned on, the ADC should continuously monitor the channel by just starting the ADC conversions before the while(1) loop.

    Best Regards,

    Diego Abad