cancel
Showing results for 
Search instead for 
Did you mean: 

Read all ADC channels triggered by a timer and use DMA - NucleoC031C6

stm32user2
Associate

Hi All, 

 

I want to read all ADC channels from the nucleo c031C6 using DMA all channels should be read continuously. For example 1k samples per seccond. I have tried to configure lots of different approaches in the CubeMX, but I can not figure it out. 

Can anyone give me a hint on how to set ADC and DMA settings in CubeMX? 

Cheers

 

2 REPLIES 2
SofLit
ST Employee

Hello @stm32user2 and welcome to the community,

You need to show what you have done at this stage: share your code, your ioc file etc.. to let others guide you to the solution.

Tips on posting a thread.

Thank you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Hl_st
ST Employee

Hello, 

I am sending simple example which periodically (1kHz) read all analog inputs and each values writes to memory by DMA and periodically print read values from memory to usart.

ADC was configured:

- All inputs except IN2, IN3 (pins used by usart), Temperature sensor, Vrefint Channel, VDDA Channel, VSSA Channel

- 8 bit resolution

- DMA Continuous Requests Enabled

- External trigger conversion source as Timer 3 Trigger Out event

- Other configurations stay as defaults

- DMA mode circular, Peripheral to memory, Data Width as Byte

TIM3 is configured as:

- Clock Source as Internal Clock

- Counter Period to 47 999

- Trigger Event Selection TRGO as Update Event

SYSCLK was configured to 48 MHz

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.