cancel
Showing results for 
Search instead for 
Did you mean: 

ADC - CCRDY and CHSELR relation ship

PGump.1
Senior III

Hi all,

I am trying to understand the relationship between CCRDY and CHSELR. Unfortunately, there is a bit of bad grammar in the Reference Manual on this subject, which is not helping...

The manual seems to say (and some examples support this) the sequence is -

ADC1->ISR |= ADC_ISR_CCRDY
ADC1->CHSELR = adc_channel;
while((ADC1->ISR & ADC_ISR_CCRDY) != ADC_ISR_CCRDY) {}; 
ADC1->CR |= ADC_CR_ADSTART; // Start the converstion

This sequence doesn't make sense. What would happen if there was an interrupt between clearing the CCRDY and writing the CHSELR?

Can anyone explain the internal workings of the ADC on this topic?

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
1 REPLY 1
TDK
Super User

Include your full chip part number. Crystal ball isn't working.

If you feel a post has answered your question, please click "Accept as Solution".