cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 ADC1 Manually selecting ADC channel with regular rank.

phuocly
Associate

Hi all,

Currently I am working on a project using STM32U575ZG with both ADC1 and ADC4 enable.
1. On both ADCs I have multiple channels enabled and every loop cycle the module will start single conversion on all of them.
2. A second ADC task I would like to perform besides the above one is to re-configure to have ONLY 1 channel per ADC and continuously make conversion during a short amount of time. Afterward, the ADCs should be reconfigure back to normal with all channels up and running without de-initialize the peripheral. This is done to save as much time as possible during conversion time and only focusing on converse a single important channel.

I use HAL_ADC_Library and when working with STM32F091 with only one ADC before this was the method I used:

 
To disable a specific channel:
ADC_ChannelConfTypeDef sConfig;
sConfig.Channel = <adc_channel>;
sConfig.Rank = ADC_RANK_NONE;
(void)HAL_ADC_ConfigChannel(hadc, &sConfig);

To re-enable it:
ADC_ChannelConfTypeDef sConfig;
sConfig.Channel = <adc_channel>;
sConfig.Rank = ADC_RANK_CHANNEL_NUMBER;
(void)HAL_ADC_ConfigChannel(hadc, &sConfig);

The issue with STM32U575 HAL Driver is that I only have ADC4_RANK_CHANNEL_NUMBER and ADC4_RANK_NONE but not the ADC_REGULAR_RANK_XX.
 
Can some one with experience about this MCU series suggest me on how to deliver the same task with HAL code or any alternatives solution? 

Thank you for reading this!
Phuoc 
0 REPLIES 0