2024-03-19 05:45 AM
Hi
I am facing an odd problem with ADC in conjunction with DMA on STM32L151V8T-A.
I can see that it measures all three channels. However, the result of each channel is stored in the first element of my results array (Result[3]).
Every time that the callback function is called the results of one out of three channels is stored in Result[0] element. It is as if the memory address is not increasing.
Can somebody help?
Solved! Go to Solution.
2024-03-20 02:14 AM - edited 2024-03-20 03:00 AM
Hi
2024-03-20 02:35 AM
2024-03-20 04:44 AM
Ok thanks. I will look at it by tomorrow or after and get back to you with a feedback
2024-03-21 05:51 AM - edited 2024-03-21 05:56 AM
Hello @Pejwaak ,
Change Data width of Peripheral and Memory to "Word" instead of "Half Word":
Please confirm if this solves your issue.
2024-03-21 09:41 AM
Hi
I have already tried it but tried it again any. I am attaching this screen-shot so you know exactly what I mean. Every-time ADC complete flag was set I took a screen shot. as you can see the value of the first element of ADCArray changes. I tested them and it turned out that these differents values are the values from each three channel.
2024-03-22 08:54 AM
I attached a project where I did 3 channels conversion in continuous mode with DMA on STM32L152D_EVAL board. Unfortunately, I don't have your board on hands.
The three converted channels are:
- Channel 31: potentiometer
- Channel 16: temperature sensor
- Channel 17: Vrefint
I tested the project with IAR, you can port it easily to CubeIDE with CubeMx.
As you can see in this screenshot, the data converted are arranged in the correct order.
You can inspire from my project to find your issue.
Please select this answer if it does answer your question.
2024-03-22 08:56 AM
Thanks very much for your kind helps. I will have a look at your project and will get back you asap.