2024-05-15 06:15 AM
Hello guys,
I tried to use the HAL_SDAC functions to read two Analog signals (0-3.3V) with DMA but I didn't have good results.
That's why I started reading only one Analog signal in Polling mode (ING 5)....unfortunately even in this case I always read zero (AD_result=0)
I am using the STM32F373 and STM32CubeIDE.
Any good ideas?
My configuration:
The code in main.c:
/* Initialize all configured peripherals */
MX_SDADC1_Init();
HAL_SDADC_CalibrationStart(&hsdadc1, SDADC_CALIBRATION_SEQ_1)
HAL_SDADC_PollForCalibEvent(&hsdadc1, 10);
HAL_SDADC_SelectRegularTrigger(&hsdadc1, SDADC_SOFTWARE_TRIGGER);
HAL_SDADC_AssociateChannelConfig(&hsdadc1, SDADC_CHANNEL_5, SDADC_CONF_INDEX_0) ;
HAL_SDADC_ConfigChannel(&hsdadc1, SDADC_CHANNEL_5, SDADC_CONTINUOUS_CONV_OFF);
HAL_SDADC_Start(&hsdadc1);
while (1){
HAL_SDADC_PollForConversion(&hsdadc1, 100); // Poll ADC1 Peripheral & TimeOut = 1mSec
AD_result = HAL_SDADC_GetValue(&hsdadc1); // Read ADC Conversion Result
}
2024-05-17 01:49 AM
thank you!
if I need it will come back here to you