cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Channel ADC STM32H743ZI2

shahaf321
Associate III

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief III

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);

 

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
AScha.3
Chief III

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);

 

 

If you feel a post has answered your question, please click "Accept as Solution".
shahaf321
Associate III

Great! Thankyou so much that did the trick