Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 10 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?"