Set up multiple ADCs on STM32 microcontrollers using DMA

  Рет қаралды 39,496

Random Rick

Random Rick

Күн бұрын

Пікірлер: 40
@markday3145
@markday3145 2 жыл бұрын
Thank you to your past self for taking the time to put this into a video for your future self, and then share it with the rest of us.
@randomrickUK
@randomrickUK 2 жыл бұрын
Future Self thanks you for your kind comment.
@kokoianer
@kokoianer 3 жыл бұрын
Great Video. I found a bug in the HAL. sometimes (not every time) the generated HAL is wrong. The MX_DMA_Init(); must be called before MX_ADC1_Init(); otherwise the ADC makes just one measurment. But this is not guaranteed always correct. (Cube IDE 1.7.0)
@gabrielfienco2531
@gabrielfienco2531 3 жыл бұрын
Thank you man!!! almost 1 day debugging and trying to find out why!!!!.. your solution solve it in seconds hehe
@ThanwaSripramong
@ThanwaSripramong 3 жыл бұрын
Thank you so much, you saved my life on this...
@erichoward6766
@erichoward6766 3 жыл бұрын
Add another THANKS SO MUCH!!! - I was about to spend several thousand $USD to get someone to fix this because I was at the end of my wits after fighting this for 3+ weeks for a product of ours that we had to redesign to fit in the L433 (from the L476). kokoianer - you are truly apprecaited. I'm going to be reaching out to the local (Austin, TX) ST support team to tell them about this - and I'll give full credit to YOU!
@dancruz21
@dancruz21 2 жыл бұрын
Thank you so much, this really saved me
@ycxv9661
@ycxv9661 2 жыл бұрын
This can be changed in the Project Manager under Advanced Settings (CubeMX 6.3, probably also in the cubeIDE)! So you don't have to change it manually in the code every time you change something in the cubeMX config. It is still weird why can be the other way round.
@glowfly
@glowfly 2 жыл бұрын
The IDE has slightly changed since this video I think. I had to click the dropdown arrows next to each "Rank" and set them to Channel 1, 2 and 3 respectively. Then the DMA worked fine with the Blackpill F401 board. This is also a kind of note-to-self thing. Cheers, great vid!
@randomrickUK
@randomrickUK 2 жыл бұрын
Hi Glowfly! I used a cheap and cheerful F030 in this video, and they don't have the ranking feature. I think the IDE "knows" this and therefore doesn't show the option.
@contomo5710
@contomo5710 Жыл бұрын
how did you adjust the timers for the adc? on the F401 i cant find an ADC clock
@KanagachidambaresanGR
@KanagachidambaresanGR 2 жыл бұрын
How many samples per second can be achieved???., Please let me know., i am working on Audio signal
@ubaidullah6261
@ubaidullah6261 2 жыл бұрын
These are not multiple ADC's but these are multiple channels ADC. Did you make videos on using ADC1 and ADC2 at the same time
@yogaline8218
@yogaline8218 Жыл бұрын
I also would like to use ADC1 and ADC2 at the same time. Did you find any information how to do it? Thanks!
@robc3863
@robc3863 2 жыл бұрын
Nice overview thanks very much! A question if I may? If someone wants to use two ADCs at the highest speed, but synchronise the readings so that 2 memory buffers receive each sample at the same time, what's the best way in your view? If software start is used they might drift by a sample or two, so use a high speed timer to activate both, one timer drives both? Can a timer run a 1MHz, I guess it can? Or is there a better way?
@dajianghe
@dajianghe Жыл бұрын
I got valid reading for only one channel; the other one is always 0. What could be the problem?
@williamrose3191
@williamrose3191 Жыл бұрын
awesome video. How can i do this with a timer?
@randomrickUK
@randomrickUK Жыл бұрын
Thanks! You can trigger ADC conversions with an "event", and set up the timer to issues those events. I've got a video about it: kzbin.info/www/bejne/h2WsaqBmoLONeKs
@mikeschem6441
@mikeschem6441 2 жыл бұрын
It looks like this example does 1 reading for each of the 3 adc channels. How do you do multiple adc readings for each channel?
@yogaline8218
@yogaline8218 Жыл бұрын
I also would like to use ADC1 and ADC2 at the same time. Did you find any information how to do it? Thanks!
@robertsutherland3303
@robertsutherland3303 Жыл бұрын
@@yogaline8218 basically repeat the same settings in as the first ADC in whichever ADC you're going to use in cubemx then call the hal functions twice with the two adc pointers (&hadc1, &hadc2)
@veikkoimmonen7300
@veikkoimmonen7300 2 ай бұрын
Set up for continuous conversions and use a bigger buffer. Then for the DMA start function, tell the size of the buffer - you will get an interrupt once the buffer is filled.
@MyMcMichael
@MyMcMichael 2 жыл бұрын
The HAL_ADC_Start_DMA function is consuming a lot of time. Since I am using it in a 50kHz regulator, it is critical to me. Is there another way to start the conversion?
@veikkoimmonen7300
@veikkoimmonen7300 2 ай бұрын
You can set the conversion to run continuously in the background, so that you will only need to call start once. The interrupt will fire once every time the buffer is filled. You can even set it up to fire separate interrupts for "buffer half full" and "buffer full", which allows you to do double buffering (useful if you need to do heavy processing on the samples while new ones are being captured).
@luisnunes24
@luisnunes24 3 жыл бұрын
Awesome Video!! Could you post the code in the description?
@GreenGuyDIY
@GreenGuyDIY 8 ай бұрын
You use volatile to tell the compiler the variable is used (updated) outside of the routines that reference it; in this case, the DMA writes to it. You need to change the title of your presentation to Set up multiple channels of a ADC for scan using DMA. This is important because was looking for setting up multiple ADCs (ie. ADC 1, ADC2, ADC3) all using scanning. Since there is only one callback I need to know how to tell which ADC DMA was completed.
@briandecker4597
@briandecker4597 7 ай бұрын
Nice Video. Thanks for uploading
@lordozi3113
@lordozi3113 2 жыл бұрын
Did the same, works flawless for 3 out of 5 channels I used... Doesn't seem to be the wiring, "adcResultsDMA" is consistently wrong on index 2 and 3, even if I use different channels in board config
@ntal5859
@ntal5859 Жыл бұрын
You probably got the RANK out of order then...
@RixtronixLAB
@RixtronixLAB 2 жыл бұрын
Nice info, thank you for sharing it :)
@eduardodelarosaferrer2205
@eduardodelarosaferrer2205 2 жыл бұрын
A flawless video
@randomrickUK
@randomrickUK 2 жыл бұрын
Very kind of you.
@zeeshantahir185
@zeeshantahir185 10 ай бұрын
You didn't setup multiple ADCs via DMA, rather multiple channels on single ADC. Caption is bit confusing
@antoniocarbajal8009
@antoniocarbajal8009 2 жыл бұрын
Thank for you jobm it was good
@patrickschwarzenecker670
@patrickschwarzenecker670 2 жыл бұрын
thx
@contomo5710
@contomo5710 Жыл бұрын
the ending gave me schizophrenia
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
HAL #13: ADC with DMA
10:15
Web learning
Рет қаралды 42 М.
STM32 ADC #1. How to configure ADC || Single Channel Polling Mode
13:55
ControllersTech
Рет қаралды 2,5 М.
STM32 Nucleo - Keil 5 IDE with CubeMX: Tutorial 6 - SPI Interface
10:56
SMT32 ADC Interrupts with STM32CubeIDE
9:49
Random Rick
Рет қаралды 13 М.
Receive data using UART in STM32 || Poll || Interrupt || DMA
14:07
ControllersTech
Рет қаралды 127 М.
For Josh: How to program your FIRST microcontroller with ease!
7:40
Hacker's Guide to UART Root Shells
17:40
Flashback Team
Рет қаралды 509 М.
STM32 ADC MULTI CHANNEL without DMA || HAL || Poll
9:22
ControllersTech
Рет қаралды 47 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН