8 years, 2 months ago.

Is there a timing dependency between calling blockSleepMode(EM1) and initiating an ADC operation?

There appears to be some timing dependency between calling blockSleepMode(EM1) and requesting the start of an ADC conversion, ADC_Start(ADC0, adcStartSingle). If I do not have the following delay, I get an intermittent bad value out of the ADC, for(j=0;j<64;j++); With the "for loop", the code appears to be solid. The code also works if I tune down the CPU clock from 28MHz to 1MHz. From looking at the blockSleepMode() routine, the only line of code I could image that would have some sort of timing dependency would be the last line of code, INT_Enable(), but I do not understand why it would. Do you know why there is a timing dependency, and is there a way that I could read a register or another deterministic way that I could determine to move onto the ADC_Start(ADC0, adcStartSingle) command than some "for loop?"

Be the first to answer this question.