2020-09-15 08:58 AM
2020-09-16 02:41 PM
Thanks JW, Actually I have it working fine now. I'd missed a setting the proper channel/stream combination for my original testing, so once I worked that out from the working example that was easy to resolve in my original test code.
2020-09-15 11:06 AM
2020-09-15 11:06 AM
DMA is just one step away from polled implementation:
Then set up ADC as you did for polling, just don't trigger it yet; set ADC_CR2.DMA, and then start the ADC triggers. You may want to experiment with manual ("software") triggering ADC first, done perhaps purely manually in debugger, while observing the NDTR register in DMA, and memory in the target buffer.
I assume you have already read the DMA-related parts of ADC chapter, and DMA chapter, in RM.
JW
2020-09-16 08:22 AM
Thanks TDK. I had actually tried patterning what I was doing after that example. Note that it is for a Nucleo-144 board and not forthe Nucle0-64 F446RE board that I'm working. That said I pulled the code from this example in and had to change the ADC input pin to match the MCU / board that I actually have. That is working, at least the DMA now works as it has for me with other things like DCMI on the H7xx series. The value being returned from the ADC is different than what I get with the Polling and Interrupt tests I did, so I'll need to track that issue down, but at least DMA is now working.
2020-09-16 08:25 AM
Thanks JW, I actually followed those steps when I was trying to integrate DMA processing from other examples from the IDE tree, but for whatever reason I couldn't get DMA to work. So I did another pass with the example listed above without trying to bring in the individual pieces, just dropped the whole code in and make the input pin change. That at least has DMA working. Now I'll go back to my original attempt to get DMA working to see what I missed.
2020-09-16 02:28 PM
As I said above, read out and observe the ADC and DMA registers content. To be humanly observable, make sure the ADC is triggered by a very slow time, or in some manual way. Compare registers content between working and nonworking cases.
JW
2020-09-16 02:41 PM
Thanks JW, Actually I have it working fine now. I'd missed a setting the proper channel/stream combination for my original testing, so once I worked that out from the working example that was easy to resolve in my original test code.