cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743, ADC_CAL flag is not cleared

STere.1719
Associate II

Hello.

I try to use ADC with STM32H743II. The problem is that the calibration flag is not reset.

//ADC1
RCC->AHB1ENR |= RCC_AHB1ENR_ADC12EN;
 
//Exit DEEP Sleep
ADC1->CR = 0;
while(ADC1->CR != 0)
{
   ADC1->CR = 0;
};
 
//Enable LDO
ADC1->CR = ADC_CR_ADVREGEN;
//dump delay, for LDO startup
for(uint32_t i=0; i<0x10000; i++){
        __NOP();
 };
    
//Start CAL
ADC1->CR |= ADC_CR_ADCAL;
while(ADC1->CR & ADC_CR_ADCAL){__NOP();}; //Program stop here forever

This code worked in another project.

If remove the calibration, then the ADC works (I use 2 regular channel with DMA).

Why can't the flag ADC_CR_CAL be reset?

1 ACCEPTED SOLUTION

Accepted Solutions

Make sure you have selected a valid clock first.

JW

View solution in original post

2 REPLIES 2

Make sure you have selected a valid clock first.

JW

STere.1719
Associate II

You're right! I checked the clock again, it turned out that one divider was not correctly selected.

It worked now, thanks a lot.