2024-07-15 07:57 PM - last edited on 2024-07-15 09:54 PM by Peter BENSCH
LDORDY bit does not exist in any registers mentioned in RM0503 rev 2 . I am using ADC1 in STM32U031R6T6 and the code migrated from STM32L010R8T6 is not working .
2024-07-16 12:15 AM - edited 2024-07-16 12:44 AM
Hello @KSB
Thank you for reporting this issue. Can you give more precision about your request. For the LDORDY bit that is mentioned on the Calibration (ADCAL) part of the RM0503, but it is not mentioned in any register, I've escalated this internally for investigation and correction if necessary (under internal ticket number 186646).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-16 04:40 AM - edited 2024-07-16 04:42 AM
Hi STTwo-32,
i am just trying to run adc in discontonous mode to measure some voltate from two resistor divider connected on channel 6 and 7 and also Vref from internal channel 12
below is the code
RCC->APBENR2|=RCC_APBENR2_ADCEN;
ADC1_COMMON->CCR=ADC_CCR_VREFEN;
ADC1->CFGR2|=(1<<ADC_CFGR2_CKMODE_Pos);
ADC1->CFGR1|=ADC_CFGR1_DISCEN;
ADC1->SMPR=0x05;
ADC1->CR=ADC_CR_ADCAL|ADC_CR_ADVREGEN;
while((ADC1->CR)&(ADC_CR_ADCAL)) // wait while adc calibraion is not complete
{};
ADC1->CR=ADC_CR_ADEN;
ADC1->CHSELR=ADC_CHSELR_CHSEL6|ADC_CHSELR_CHSEL7|ADC_CHSELR_CHSEL12;
ADC1->CR=0x05; //ADC enable and start conversion.
uint16_t adc_data=ADC1->DR;
It gives me a fixed value reading of approx 0x98b channel 5 , 0xfff for channel 6 and 0x5df for channel 12 in the DR after conversion.
Could not find any examples of ADC on a U0 . I dont' know where I am making mistake because this same code worked on STM32L010R8T6.
2024-07-16 05:09 AM
This issue is not the same issue reported on the original request. I suggest you close this one and create a new one for the new request to give it more visibility. As a suggestion, you may want to take a look at the examples of the STM32CubeU0. They should be helpful.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.