cancel
Showing results for 
Search instead for 
Did you mean: 

adc & dma problem in stm32f103

hamed taran
Associate II
Posted on November 24, 2017 at 00:22

Hi

I want to use dma and adc in such a way that the samples taken in a thousandth array are written. But this action only once and with my command, and then stop to issue the next command. Additionally, the adc speed is at its highest. Please guide me how to set the cubemx and what code to write. I apologize for the mistakes of sentences. I'm not fluent in English.

4 REPLIES 4
hamed taran
Associate II
Posted on November 27, 2017 at 17:31

Please answer. tnks

T J
Lead
Posted on November 28, 2017 at 01:07

do you have a sample cube file ?

its easy to do...

post your sample cube file here, I will show you the coding points / methodology

Posted on November 28, 2017 at 02:41

Hi

Thanks for answer

This is my cubemx and main.c file:

http://up2www.com/uploads/6d2fcubemx-c.zip

T J
Lead
Posted on November 28, 2017 at 05:17

this is the code to get the data; I hacked this together, I have more than one channel running, my code is different

extern 'C' void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){  HAL_ADC_Channel_Buffer [Counter] = ADC_DMABuffer[0]; Counter ++ &= 0xff;//256 byte buffer autoamtically loaded by the ADC callback  } �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

________________

Attachments :

Sample F103C8 ADC.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyHR&d=%2Fa%2F0X0000000b5V%2FA.Og1waA6hJ0Fxhl0DmV7G_GIZG2sZ6gTDsY33mtATk&asPdf=false