Part 2 of 2 ADC to DAC via DMA

  Рет қаралды 8,378

ENGRTUTOR

ENGRTUTOR

Күн бұрын

Пікірлер: 32
@CuriousMotor
@CuriousMotor 4 жыл бұрын
I'm genuinely surprised how such a gem of a video is so underrated! I've never come across such an explanation in any of the embedded system related youtube channels!
@weiwendai
@weiwendai 4 жыл бұрын
The best video explaining, step-by-step, how to use ADC, DAC and DMA all together for real-time application. It illustrates a real-life example using half buffer for data transfer and signal processing. Thank you very much for making this great video!
@burhanmuhyiddin4372
@burhanmuhyiddin4372 5 жыл бұрын
Thank you very much for your tutorial. I have successfully implemented my project on STM32 discovery board by the help of your tutorial. My project was to capture sound from the microphone and save it to the sd card in order to replay again :)
@KenDedes94
@KenDedes94 4 жыл бұрын
Hello! Im having problems trying to set up the right timer for the same board. Can any of you help me ?
@ari097
@ari097 5 жыл бұрын
The two videos are very useful! Thanks
@babotvoj
@babotvoj 4 жыл бұрын
why did you put the signal processing function into the main loop without any if statement? Wouldn't it mean that it could be executed multiple times per cycle? How do you know it will be executed just once?
@terranceparker2015
@terranceparker2015 11 ай бұрын
Great video and like your other content and will subscribe.
@KanagachidambaresanGR
@KanagachidambaresanGR Жыл бұрын
Great video., you help to print he value in uart. so that i can read the store the value.
@sarbog1
@sarbog1 2 жыл бұрын
Very cool, I implemented this on the STM32F429I-DISC1 Discovery... works great!
@MuhammadAli-ku9dg
@MuhammadAli-ku9dg 2 жыл бұрын
Very nicely explained. Just 1 query. Why did you put the process function in while loop and not the half/full routines ?
@sovpadatorvolin369
@sovpadatorvolin369 2 жыл бұрын
Why your ProcessData() runs continuously in while(1) loop? Actually it should be executed exactly after each half of adc_val is filled!
@raybuck9675
@raybuck9675 4 жыл бұрын
Excellent explanation of ADC, DAC, and DMA working together while not consuming CPU cycles. In your example, the ADC to DAC transfer runs all the time. If Timer6 is not running, I assume the transfer would not happen. Is that correct? If so, I should be able to monitor a switch in the main while(1) loop and use the switch to turn Timer6 on and off. My idea is to only have the ADC to DAC transfer take place when the switch is closed. Do you think that is practical or would there be a better way to accomplish my task?
@federicocoppede1681
@federicocoppede1681 4 жыл бұрын
The explanation is excellent, thank you very much! I have a question, for the processing function, shouldn't you have a flag to stop processing until the other half is ready? Otherwise you process over and over the same buffer until the pointers are swapped. Perhaps after the processing function ends the core could be put to sleep until the next interrupt to save some energy. Just a thought, great tutorial.
@hardware994
@hardware994 4 жыл бұрын
I was thinking the same. A flag may be set by the ADC-DMA callbacks and reset by the processing function, which is entered only if such flag is true. In this way, the MCU avoids looping on the same slice of buffer more than once. I suspect the almost invisible glitches and spikes that one can observe from the DAC capture are caused by the missing "synchronization" mechanism.
@scsumeetchandra
@scsumeetchandra 4 жыл бұрын
Thanks for this great tutorial! I have a question about your signal generator - is there a reason you put an offset on the sine wave? I noticed when I left this out my negative values were truncated. Is there a specific setting for the ADC to set the reference voltage?
@johnsaeid95
@johnsaeid95 5 жыл бұрын
I have a question about DAC with DMA How can I use DAC with DMA without using Timer as a trigger , I wanna give an array every time to DAC through DMA to transfer the array with the speed of DMA , but without using the TIMER,, How is that possible
@alarmkoguvenlik
@alarmkoguvenlik 3 жыл бұрын
You explained great, thank you. Can't we assign the address of the dac memory directly as the adc address, without copying?
@ENGRTUTOR
@ENGRTUTOR 3 жыл бұрын
The end-goal isn't to just read data from ADC and send to DAC. The goal is to take the data from ADC - process it - and then send the data to DAC. Hence the two different pointers and memory spaces.
@nisarggandhi1157
@nisarggandhi1157 4 жыл бұрын
Can you upload/share the code for this?
@kaluvanhariharan4256
@kaluvanhariharan4256 5 жыл бұрын
Very nicely explained. Is this configuration and coding work work for STM32H743? I followed the steps as such but it is not functioning? will you help me to sort out this.
@JanKowalski-sw6qe
@JanKowalski-sw6qe Ай бұрын
Skonfiguruj MPU lub wyłącz wszystkie ...Cache
@David-nk7pv
@David-nk7pv 5 жыл бұрын
Hello, GREAT tutorial and explanations... I have one problem though, when I load the program and go into debug mode, the valueS of adc_val only change once, at the beginning (when I click on "Run"), after that it stays with the same value. The buffer gets filled up once, and then it doesn't change. Any idea why this might be? Thank you so much. EDIT: I'm using stm32f746ng Discovery, don't know if that makes a difference
@David-nk7pv
@David-nk7pv 5 жыл бұрын
Nevermind, I found the problem! I had disabled the DMA continuous requests :D
@syedafzal2062
@syedafzal2062 3 жыл бұрын
@@David-nk7pv heyy I am facing the same problem. What did you change in the code? I checked that my DMA is already in circular mode
@salehpaz
@salehpaz 4 жыл бұрын
on the code description you wrote The data transfer between the ADC to Memory and from Memory to DAC is handled by DAC. Do you mean *is handled by DMA?
@ENGRTUTOR
@ENGRTUTOR 4 жыл бұрын
Yes DMA. Thanks for catching this.
@Alan96555
@Alan96555 2 жыл бұрын
How can io change the samplig rate?
@rodrigokea
@rodrigokea 5 жыл бұрын
Great videos! I have a question, how about that Jitter on the output, I have the same problem. Do you now the source of that problem? Thanks and sorry if I write it wrong, I'm from. Argentina.
@franky7025
@franky7025 4 жыл бұрын
I think there is an error in the double buffer management. Processing of the date has to be directed to the same half of the output buffer. Input and output DMA are started at the same time. Think about that.
@Marco-wz3hv
@Marco-wz3hv 4 жыл бұрын
Just put a delay of 1ms between HAL_ADC_Start_DMA and HAL_DAC_Start_DMA.
@Marco-wz3hv
@Marco-wz3hv 4 жыл бұрын
I now see the necessary delay isn't always 1 ms. You need to play around with it depending on what your DSP application is. I think the idea is that you have to start the DAC between when the ADC buffer is half complete and fully complete.
@11harinair
@11harinair 3 жыл бұрын
@@franky7025 Yes. And the process_data() function needs to be triggered by a flag set in the conv_complete() and conv_half_complete() callbacks. I've tested this on an F407 board and it works fine with these fixes.
Timer Triggered DAC output
14:46
ENGRTUTOR
Рет қаралды 9 М.
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 28 МЛН
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 93 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 5 МЛН
HAL #13: ADC with DMA
10:15
Web learning
Рет қаралды 41 М.
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Mitch Davis
Рет қаралды 204 М.
DAC in STM32 || Sine wave || HAL || CubeIDE
16:07
ControllersTech
Рет қаралды 67 М.
STM32 ADC multiple channels || DMA || True studio || CubeMx
15:47
ControllersTech
Рет қаралды 69 М.
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 28 МЛН