Hello there.
Arduino with "STM32F411CEU6 blackpill board" with 12 bit resolution
I am trying to read an analog value.
STM32 1.9.0 library is installed.
When I try to read data with analogRead it reads slowly.
Is there anyone who can write sample code with Arduino?
I looked in stm32f2xx_hal_adc.h but could not write a working code.
Please help
Arduino STM32F411CEU6 ADC Read Problem
Re: Arduino STM32F411CEU6 ADC Read Problem
Hi,
analogRead API is really a basic API and is not designed for performance.
Unfortunately, currently there is no other high level API for this. Your best bet is to use HAL/LL for this.
You can try to port an STM32Cube F4 project. I've made it as an example for F1:
viewtopic.php?f=41&t=110
There is several example using the LL:
https://github.com/STMicroelectronics/S ... les_LL/ADC
Don't forget this as it is mentioned in the example for F1: disable the HAL ADC usage by the arduino API by defining -DHAL_ADC_MODULE_ONLY in build_opt.h file.
analogRead API is really a basic API and is not designed for performance.
Unfortunately, currently there is no other high level API for this. Your best bet is to use HAL/LL for this.
You can try to port an STM32Cube F4 project. I've made it as an example for F1:
viewtopic.php?f=41&t=110
There is several example using the LL:
https://github.com/STMicroelectronics/S ... les_LL/ADC
Don't forget this as it is mentioned in the example for F1: disable the HAL ADC usage by the arduino API by defining -DHAL_ADC_MODULE_ONLY in build_opt.h file.