cancel
Showing results for 
Search instead for 
Did you mean: 

Problem reading multiples channels on ADC on STM32F303.

JLojo
Associate III

Hello,

I'm new to STM32 world (but I know a little about MCUs...) and I'm trying to read several channels on ADC on STM32F303 MCU. I've tried to follow tutorials from Internet, but none of them seems to use version 5.0 of CubeMX, which may lead to inconsistent settings... actually if I simply try to reproduce wha is done in the tutos, nothing is happening.

I'd like to use either Interrupt or DMA driven readings.

I think I've been able to read through DMA but unfortunately when I do so, it seems that I do have incompatibilities with GPIO settings. At least I'm using USB device to communicate the acquired data and the USBP pin is connected to a GPIO throuhg a 1.5K resistor and this GPIO is pulled up after booting to force USB to enumerate on the computer. This works perfectly when HAL_ADC_Start_DMA is not called, but stop working as soon as ADC_DMA is started... However, using debugger, I can see that ADC data are transferred through DMA buffer.

Using IT, and recursive calls to HAL_ADC_GetValue I read something, but not sure it corresponds to what it should...

I'm thus getting really confused.

Is there a clear tutorial on how to setup and use ADC on STM32F303 using CubeMX V5.0?

I'm even confused withthe version of CubeMX since About box says :

STM32CubeMX

Version 5.0.0

STM32Cube V1.0

...

Anyway, this is the latest one downloaded from ST website.

Basically, I simply need to acquire 6 channels - 12 bits each, at a rate which is not critical, but above 20 KHz in operation (so far I'm testing it on a 1 acquisition per second basis, triggered by software).

Thanks

jyl

0 REPLIES 0