Skip to main content
Visitor II
October 1, 2024
Question

ADC multiple Channel issue

  • October 1, 2024
  • 3 replies
  • 3676 views

I have issue for ADC multiple channel not working. I am using nucleo-H503RB board. I am select ADC1 of IN0,IN1,IN3,IN5,IN14,IN19. But its read value only IN0.

    This topic has been closed for replies.

    3 replies

    Visitor II
    October 1, 2024

    Can you check, I have attached main.c and ioc file

    Super User
    October 1, 2024

    > hadc1.Init.NbrOfConversion = 6;

    Se up the ADC to convert only a single channel, not all 6.

    Before conversion, set the channel in rank 1 to what you want it to be. Only change the channel number here.

     sConfig.Channel = ADC_CHANNEL_0; // <-- only change this each iteration
     sConfig.Rank = ADC_REGULAR_RANK_1;
     sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;
     sConfig.SingleDiff = ADC_SINGLE_ENDED;
     sConfig.OffsetNumber = ADC_OFFSET_NONE;
     sConfig.Offset = 0;

     

    Visitor II
    October 1, 2024

    Above changes i was already doing but its not work.

     

    Super User
    October 1, 2024

    Include your modified main.c file.

    Visitor II
    October 3, 2024

    What i include in my main.c file. I can't understand what you are saying.

    Visitor II
    October 10, 2024

    Not Accepted solution. My issue has not resolved. 

     

    Graduate II
    October 10, 2024

    If you're unable to figure it out, there is always Plan B