cancel
Showing results for 
Search instead for 
Did you mean: 

I want use ADC on stm32f030k6t6 with two channel, and using DMA to set regular value, I config it in stm32cubemx,but I don't know how to start conversion and wait conversion stop correctly, I need someone help or some example, in LL library, thanks.

eyan.11
Associate

in generated code, I don't find dma set memory address, so I add

uint16_t regular_data[2];
 
......
LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_1, 
LL_ADC_DMA_GetRegAddr(ADC1, LL_ADC_DMA_REG_REGULAR_DATA),                                    (uint32_t)&regular_data[0],
LL_DMA_DIRECTION_PERIPH_TO_MEMORY);

in main.c, I enable adc and dma:

LL_ADC_Enable(ADC1);
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_1);

I'm no sure the codea are correct.

1 REPLY 1
Imen.D
ST Employee

Hello @eyan.1​ and welcome to the Community 🙂

You can refer to this wiki article on ADC topic, that can help you on how to configure ADC.

Hope this helps you!

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen