cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152ZD ADC+DMA makes random values!

kupchykdaniil
Associate III
Posted on July 11, 2014 at 15:58

The original post was too long to process during our migration. Please click on the attachment to read the original post.
2 REPLIES 2
Posted on July 11, 2014 at 16:59

If they are not connected how would they be able charge/discharge a capacitor to a know voltage? Unless you tie those pins to ground, they aren't going to be zero. You are likely to see whatever leakage is occurring.

Also, why would you generate interrupts at this rate, if you want to do a large number of samples, then let the DMA do that into a bigger array, ideally one twice as big as needed so you could process half of it at a time without the next DMA operation overwriting the data as you attempt to use it?

Probably wouldn't enable/disable TC in the interrupt either, you really don't want to try and collect data faster than you can process it.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kupchykdaniil
Associate III
Posted on July 11, 2014 at 17:33

1) I thought that floating pins are internally pulled to GND and  measured values would be near zero. I have to do it manualy. 

2) Interrupts are really made in a wrong manner...  I don't know what to do with a twice bigger array and Half Transferred interrupt. May be I have to do bigger array and fill it in a one pass and in the TC interrupt just set data ready flag? If any overrun happens  it should to repeat transfer from begining. No any interrupt disabling anymore, I understood as it can cause data racing.

3) But what I should do with abnormal data in the first channel, that is tied to 2.16V voltage? It looks like random data. 

Thanks for your help, Clive.