Skip to main content
MKunz.1
Associate II
November 16, 2020
Solved

Has anyone implemented the ADC calls with LL commands for G4

  • November 16, 2020
  • 1 reply
  • 792 views

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

This topic has been closed for replies.

1 reply

TDK
TDKBest answer
November 16, 2020
"If you feel a post has answered your question, please click ""Accept as Solution""."