cancel
Showing results for 
Search instead for 
Did you mean: 

ADC in Dual Mode with DMA storing issue

Timothy Smieja
Associate II
Posted on August 14, 2017 at 23:38

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 August 15, 2017 at 01:45

Dual mode ADC should use a single DMA, reading data from the CDR (Common Data Register) as 32-bit word, containing the data from both channels, or reading it twice as 16-bit words (Mode 1).

This is really easy to demonstrate with the SPL, the HAL/CUBE evidently not so much.

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Timothy Smieja
Associate II
Posted on August 16, 2017 at 00:07

Thanks for responding Clive One. Your link to the other page mainly worked with the old SPL which in some areas is very different than the Cube/Hal stuff. With the Cube, DMA_Mode_1 is not an option, but it did make me think about the settings.

I was finally able to get the Dual Mode to store both ADC1 and ADC2 from the C_ADC C_DR into my buffer. In the previous attached image, ADC1-3.jpg, I needed to set the ADC1  DMA data width to Word rather than Half Word.

I do have another question for you, maybe you have some insight. Do you know if you can run in Constant Conversion mode in dual mode. I tried it, but needed to poll it in order to get data into the buffer. The only difference seemed like it would fill the whole buffer with measurements rather than just a pair of measurements with Constant Conversion disabled.

I'm not sure I need it, since I've tried it with the ADC1 and 2 configured as independent and scan mode, and it seemed like it hogged all of the time and never ran any mainline code. I couldn't see where I could throttle it back by adjusting some ADC sample time.