Tool/software:
Hello,
the MSPM0G1519 reference manual states that CTL0.ENC bit must be 0 before MEMCTL[y] can be written.
Yet it is also stated that after CTL0.ENC has been set to 0 the current conversion will finish and result stored in corresponding MEMRESx.
There is an additional BUSY flag in the STATUS register offering the possibility to check if the last conversion has finished (e.g. after setting ENC=0).
Question: What happens if I set CTL0.ENC=0 and write MEMCTL[y] immediately (which is allowed according my interpretation of the reference manual) and there is still an ongoing conversion?
In above scenario we observe that the if enabling conversions again (CTL0.ENC=1) the conversions are actually not started. The code below shows the sequence.
DL_ADC12_disableConversions(ADC1);
DL_ADC12_configConversionMem(ADC1, ...);
DL_ADC12_enableConversions(ADC1);
Yet if we wait after disabling conversion until STATUS.BUSY=0 (which is not mentioned in reference manual) then it works as expected. Working pseudo code below.
DL_ADC12_disableConversions(ADC1);
while(DL_ADC12_getStatus(ADC1) & DL_ADC12_STATUS_CONVERSION_ACTIVE) {};
DL_ADC12_configConversionMem(ADC1, ...);
DL_ADC12_enableConversions(ADC1);
Is this to be expected? Is this information missing in the reference manual?
Best Regards
Marco Marder