2024-08-05 12:47 AM - edited 2024-08-05 12:48 AM
Hi,
I have tried to setup the ADC in STM32H753ZIT6, to sample more than one channel by using the polling method.
So far I have not been successful. I have tried to follow guides and Youtube videos. What they all seem to do is to enable the wanted channels and then also only enable one "Number of Conversions". In the software they then switch channels like shown below. But this only read the same channel.
I hope and believe this should be fairly straight forward, but I can simply not get it to work.
Any help or inputs are appriciated.
Thank you
sConfig.Channel = channel[i];
sConfig.Rank = 1;
HAL_ADC_Start(&hadc2); // Start ADC Conversion @ Selected Channel
HAL_ADC_PollForConversion(&hadc2, 1000); // Poll The ADC Channel With TimeOut = 1000mSec
ADC_result[i] = HAL_ADC_GetValue(&hadc2); // Read The ADC Conversion Result
HAL_ADC_Stop(&hadc2); // Stop conversion
2024-08-05 03:34 AM
> In the software they then switch channels like shown below. But this only read the same channel.
Does that code write the desired channel into ADC registers at all?
Cube is open source, so you can debug it as your own code.
JW
2024-08-07 12:23 AM
Hi,
Thank you for the reply. I think I will park this for now as I will use the DMA method instead. Whgich I can get to work but now I have a calibration issue, which I think I will open a new thread on.
Thank you all.
Br.