Skip to main content
Graduate II
January 1, 2024
Solved

Multiple Channel ADC STM32H743ZI2

  • January 1, 2024
  • 2 replies
  • 1409 views

Hi all, i'm experimenting using ADC  in STM32H743ZI2

i managed to get the single channels working on ADC1 and ADC2,

and i want to use ADC3 with multiple channels, oncourse i followed all the manuals in youtube etc.. but still no luck

i am using ADC3 channels 1 5 6 8.

i am transferring the data to DMA and i am waiting for the conversion to finish but it never does.

any help or ideas will be appreciated. 

these are my settings and code (with all the insignificant parts cleared off)

many thanks!

 

 

uint8_t convCompleted=0;
 
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
{
printf("convcmplt:  %d\n",hadc);
convCompleted=1;
}
 
 
 
int main(void)
{
 
  HAL_Init();
  SystemClock_Config();
  PeriphCommonClock_Config();
 
  MX_GPIO_Init();
  MX_ADC1_Init();
  MX_ADC2_Init();
  MX_ADC3_Init();
  MX_BDMA_Init();
 
  HAL_ADC_Start_DMA(&hadc3, (uint32_t *)rawValues, 4);
 
  while(1)
  {
  while(!convCompleted);
  printf("A:%d\nB:%d\nC:%d\nD:%d\n\n",rawValues[0],rawValues[1],rawValues[2],rawValues[3]);
  HAL_Delay(1000);
  }
}

 

shahaf321_0-1704106244590.png

shahaf321_1-1704106282640.pngshahaf321_2-1704106301681.pngshahaf321_3-1704106322293.pngshahaf321_4-1704106357757.png

 

    This topic has been closed for replies.
    Best answer by AScha.3

    Hi,

    BDMA can only access SRAM4 area, so you have to put your rawValues in this memory !

    I would just use DMA1 or 2 , can access all ram areas. 

    see rm :

    AScha3_0-1704111216881.png

    +

    You might need to init dma :

     

    HAL_DMA_Init(&hdma_adc3);
    HAL_ADC_Start_DMA(&hadc3, (uint32_t *)rawValues, 4);

     

     

    2 replies

    AScha.3Answer
    Super User
    January 1, 2024

    Hi,

    BDMA can only access SRAM4 area, so you have to put your rawValues in this memory !

    I would just use DMA1 or 2 , can access all ram areas. 

    see rm :

    AScha3_0-1704111216881.png

    +

    You might need to init dma :

     

    HAL_DMA_Init(&hdma_adc3);
    HAL_ADC_Start_DMA(&hadc3, (uint32_t *)rawValues, 4);

     

     

    shahaf321Author
    Graduate II
    January 1, 2024

    Great! Thankyou so much that did the trick