wrong values- adc with dma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 12:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 1:47 AM
Probably negative voltage / Offset
try:volatile int16_t Buffer[12];- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 2:57 AM
no its not working when i change it ...its even getting worse values...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 4:25 AM
Try
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 4:25 AM
Hello,
I would suggest you to Have a look at the ADC_DMA example in the STM32F4 Standard Peripherals Library.You can download it from thishttp://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1939/PF257901
I hope this helps,Syrine.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-14 9:37 AM
The left shift is definitely going to produce large values. It's important to read and understand the documentation.
With ADC measurements, you often want to test by looking at the values in decimal and hex, for inputs tied to GROUND and then VREF. If you get surprising values, review the documentation again.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-15 12:33 AM
thank you clive.
yes, it does. i have look at the documentation and calculated according to that. i am getting proper values when i calculate for the first time. but i need to reset to calculate again. if i dont do reset then it gives value 0.why its is like that?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-15 6:08 AM
Ok, you have an array with 12 elements, you tell the DMA controller it has 24, and then print 20. You need to pick something and apply it consistently.
If you program the DMA in Normal mode you'll need to reinitialize it each time. Circular mode will keep repeating. I would not use EOC, but rather the DMA HT/TC flags to determine if the array was filled. I've posted working examples, perhaps a careful review of those would help.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-15 6:59 AM
clive, can you tell me how the dma is 24?... according to my knowledge, the buffer size is the dma size... if not correct can u tell me how its 24.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-07-22 10:35 AM
clive, can you tell me how the dma is 24?... according to my knowledge, the buffer size is the dma size... if not correct can u tell me how its 24.
