2025-01-08 11:14 AM
ADC1 configured as
Mode "Independend Mode"
Scan Conversion Disabled
Continuous Conversion Enabled
Discontinuous Conversion Disabled
DMA Continuous REequests Enabled
End of Conversion "EOC Flag at the end of single conversion"
DMA2 configured as
Direction "Peripheral To Memory"
Mode "Circular"
Increment Adress Memory (Peripheral is unchecked)
Start code in main.c :
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_USB_DEVICE_Init();
MX_I2C1_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
//where?? HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc1,(uint32_t*)&value_adc,1); <= fetches only one value !
Questions:
What file to include for HAL_ADCEx_Calibration ?
Why do I have to guess the Include file's name ?
Will Calibration make the DMA Transfer autorepeat (??) or just enhace accuracy?
What is missing for "autorepeat DMA" ?
Where do I see how frequently the ADC will run, if at all?
What does "circular" do w/o being given a buffer to write multiple values to, in a circular fashion?
Somehow I'm truly wishing there were a Guide, with naming examples (took me a while to figure out the names for port and gpio pin) and descriptions what one has to do manually after changing the configuration (like add includes files CubeMX has forgotten..)
Solved! Go to Solution.
2025-01-08 11:27 AM
Here's an example for continuously capturing ADC values into a single location with circular DMA:
You can use the Example Selector to load this into STM32CubeIDE and run it. May need modified slightly for your specific chip.
HAL_ADCEx_Calibration_Start doesn't exist on STM32F4.
2025-01-08 11:27 AM
Here's an example for continuously capturing ADC values into a single location with circular DMA:
You can use the Example Selector to load this into STM32CubeIDE and run it. May need modified slightly for your specific chip.
HAL_ADCEx_Calibration_Start doesn't exist on STM32F4.
2025-01-08 11:51 AM
@TDK wrote:HAL_ADCEx_Calibration_Start doesn't exist on STM32F4.
TDK, thanks for pointing this out!