Skip to main content
YHaag
Visitor II
March 29, 2019
Question

ADC_DMA

  • March 29, 2019
  • 1 reply
  • 531 views

I'm new to the topic and have a basic question.

I set up a ADC_DMA transfer to read sensor values: HAL_ADC_Start_DMA(&hadc1, (uint32_t*)&ADC1ConvertedValue, 1)

This works to always update the ADC1ConvertedValue variable to the latest value.

But how can I adjust my buffer size? In the end I would like to read for example 1000 values, then get an interrupt and use those 1000 values all at a time.

Thanks a lot and forgive me if the question is stupid ;)

This topic has been closed for replies.

1 reply

S.Ma
Principal
March 29, 2019

Use dma cyclically on 2000 samples. Half transfer 1000 interrupt will occur so you can process 1000 samples in the same time it wilk take to receive the other half.