2020-11-16 01:04 AM
Dear
I have configured ADC3 using MXcube:
In my main I tried this:
LL_ADC_ClearFlag_ADRDY(ADC3);
LL_ADC_Enable(ADC3);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
LL_ADC_ClearFlag_EOC(ADC3);
LL_ADC_ClearFlag_EOS(ADC3);
LL_ADC_REG_StartConversion(ADC3);
while(LL_ADC_IsActiveFlag_EOS(ADC3) == 1);
uint8_t ui_Rank;
uint16_t uw_ADC3_Conversions[10];
ui_Rank = 1;
while(ui_Rank < 11)
{
uw_ADC3_Conversions[ui_Rank-1] = LL_ADC_INJ_ReadConversionData12(ADC3, ui_Rank);
ui_Rank++;
}
float f_Temperature;
f_Temperature = uw_ADC3_Conversions[9] / 3.6416; // Temperature calculation
... End of snippet
The results are always 0.
I don't know where the problem is.
Best regards
Martin
Solved! Go to Solution.
2020-11-16 05:23 AM
> Has anyone implemented the ADC calls with LL commands for G4
Yes. Of of several examples:
2020-11-16 05:23 AM
> Has anyone implemented the ADC calls with LL commands for G4
Yes. Of of several examples: