2022-11-29 11:58 AM
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?
Solved! Go to Solution.
2022-11-29 04:10 PM
2022-11-29 04:10 PM
Make sure you have selected a valid clock first.
JW
2022-11-30 03:24 AM
You're right! I checked the clock again, it turned out that one divider was not correctly selected.
It worked now, thanks a lot.