2024-08-01 03:21 AM
i have program like this and from the program i have the output like this (picture) and i used the potentiometer to find the value is AD_RES_BUFFER:
the potition of picture is disable of DMA Countinous Request ADC ANALOG
but the potentiometer work (produces value ) if i enable the 'DMA Countinous Request' in stm32cubeMX i used the nucleof334r8 but the value of b and output is 0 (zonk).
and if i disable the 'DMA Countinous Request' in stm32cubeMX the potentiometer doesn't work (produces no value if rotated) and only displays value randomly and i dont know from where the value, but i have a value of 'output, b' in watch 1.
so i want to enable the 'DMA Countinous Request' and get the value of potentiometer (REAL TIME AND UPDATE ID I ROTATED THE POTENTIO) but i dont know how to set it in cubeMX and prgram the keil.
PLEASE ANYONE HELP ME.
Solved! Go to Solution.
2024-08-01 04:26 AM
Hi @meriarajagukguk ,
Try first a working example to understand how it works. Then you can update it to your specific needs.
I suggest you start with this MOOC: STM32CubeMX basics: 13.2 STM32Cube HAL labs ADC - Lab ADC DMA (youtube.com).
You will need to select STM32F3 instead of STM32F4 and Keil instead of IAR.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-01 04:26 AM
Hi @meriarajagukguk ,
Try first a working example to understand how it works. Then you can update it to your specific needs.
I suggest you start with this MOOC: STM32CubeMX basics: 13.2 STM32Cube HAL labs ADC - Lab ADC DMA (youtube.com).
You will need to select STM32F3 instead of STM32F4 and Keil instead of IAR.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-01 07:47 AM
but I'm using a NUCLEO STM32F334R8 not the F4 SERIES and I should already understand how it works, it's just that I'm confused about applying it to the STM32cubemx and there's little software that has to be used.
any other ideas?
2024-08-01 04:49 PM - edited 2024-08-01 04:54 PM
Debug your code and see where it's at. By that I mean hit the debug button, ensure it's running, let it run a few seconds and hit pause. See where execution is at. Set a breakpoint at the line that assigns b and see if it gets hit.
At a wild guess, probably you are stuck in neverending ADC interrupts because your sampling time is too small.
2024-08-01 06:22 PM - edited 2024-08-01 06:22 PM
Do you happen to have an example? I'm a beginner, so I'm confused about how to check and set a breakpoint?
2024-08-01 07:50 PM - edited 2024-08-01 07:51 PM
Plenty of resources out there on how to debug and program. Google is your friend. If your intention is to learn, having other people write your code won't help you in the long run.
Did you try at all? What is your sampling time? Did you increase it?