Arduino STM32F411CEU6 ADC Read Problem

Post here first, or if you can't find a relevant section!
Post Reply
serkansatuk
Posts: 8
Joined: Mon Mar 16, 2020 8:46 pm

Arduino STM32F411CEU6 ADC Read Problem

Post by serkansatuk »

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 :( :(
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino STM32F411CEU6 ADC Read Problem

Post by fpiSTM »

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.
Post Reply

Return to “General discussion”