This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CubeMX - Multiple Channel ADC+DMA

I Can't found reference for read all substract of array in MDK V5, where is the code generate from CubeMX it's activate adc1, adc2, adc3, adc5, adc6,& adc7. can any one help me ?


  uint8_t ADC_buffer[6];

  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_ADC1_Init();
  MX_USART1_UART_Init();

  HAL_ADC_Start_DMA(&hadc1, (uint32_t *)ADC_buffer, 6);

  while (1)
  {
        A1=ADC_buffer[0];
        A2=ADC_buffer[1];
        A3=ADC_buffer[2];
        A5=ADC_buffer[3];
        A6=ADC_buffer[4];
        A7=ADC_buffer[5];
   }

Parents
  • Your question really doesn't make a lot of sense. Is this the appropriate forum?

    There's no indication of the processor, or how any of the pins are configured.

    What is the problem reading the elements of the array? Should the array be volatile? Are the samples 8-bit wide? Should you be waiting on some event to know the samples are ready?

    Where is A4?

    What exactly is the problem?

Reply
  • Your question really doesn't make a lot of sense. Is this the appropriate forum?

    There's no indication of the processor, or how any of the pins are configured.

    What is the problem reading the elements of the array? Should the array be volatile? Are the samples 8-bit wide? Should you be waiting on some event to know the samples are ready?

    Where is A4?

    What exactly is the problem?

Children