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.

MSPM0L1306: ADC conversion complete checked by polling

Part Number: MSPM0L1306

Hi,

I am using ADC channel 0 for voltage conversion, which needs to be read when needed, its not time based operation we can say if specific conditions becomes true by some external event only then i need ADC reading.

so for this i need to poll the adc only for that time and i'm not using adc again till next time.

so i also don't need adc conversion mem register interrupt to be generated. How can i achive this adc polling?

i have checked with TRM that we have BUSY bit in ADC STATUS register to monitor the adc operational status, but it only gives the ADC enable/disable status.

i want to wait for ADC conversion completion once started and only after completion i need to proceed, so how to achieve this polling of conversion complete in adc?

any input will be helpful.

Thanks.

  • I think you can:

    1. Don't enable the ADC interrupt.

    2. Read the ADC conversion flags to know whether the ADC conversion is finished.

  • Thanks for the reply Eason, i solved that issue few hours ago. As you rightly pointed out i did the same thing without enabling the ADC interrupt, monitored the RIS register for ADC mem-0 bit via DL_ADC12_getRawInterruptStatus(); this returns value if new value is loaded into ADC mem-0 by monitoring this bit i was able to poll ADC conversion.

    At the end i also cleared the ADC interrupt status by DL_ADC12_clearInterruptStatus(); otherwise next time when we poll adc again  DL_ADC12_getRawInterruptStatus() will always return 1. we need to clear this interrupt status bit at the end of adc polling.

    Thanks.