2013-10-01 03:17 AM
2013-10-01 03:52 AM
What processor, at what speed?
This is all rather a mess, the timebase suggests a sample rate closer to 1 Hz than 200 Hz (5ms), yet you use only 3-cycles for the ADC which will give hideous readings. Why would you not use a TIM based trigger for the ADC/TIM? Why would you not have a very deep DMA buffer? The number of channels is ONE, you want a scan list of ONE channel per ADC. The #defines are missing so can't confirm the pins involved. Writing to the SD card you want to be writing blocks >512 bytes, and ideally multiple KB tending toward a cluster in size. The DMA interrupt is not enabled via the NVIC. Again try to avoid an interrupt for every 3 samples. Some odd processing going on, not sure why/how. Do you want the convert to millivolts, or scale in some way? If the numbers are in the form you want just do a memcpy, or make the buffer large enough and split in two, so the SD write can occur in-place. The DMA is configured for 32-bit words, 3 x 32-bit words into array of 3 x 16-bit words does not fit.2013-10-01 04:24 AM
Hi Clive,
first of all, thanks for responding. I'm using STM3241G-EVAL board with STM32F417IGH6. I used some sample programs to write my code, and for this reason there may be some errors.In my final program, i want to interrupt timer evvery 5ms, but now, to see the leds I use 2s of period.Secondly, I don't know how to use a TIM based trigger for the ADC/TIM and how it works.About the channels, I need to take 2 samples in ADC1, in channels 16 and 18. So, is not correct the number of channels?I will write 5mb in my SD card, but now is just a program testing.How can I enable the DMA interrupt via NVIC? I tried doing it as the timer, but it doesn't work.Finally, I want the values without conversion, I will use another program to convert the ADC values. I will change uint_32 for uint_16.Thank you very much.Miquel2013-10-01 02:21 PM