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!
@weiwendai4 жыл бұрын
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!
@burhanmuhyiddin43725 жыл бұрын
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 :)
@KenDedes944 жыл бұрын
Hello! Im having problems trying to set up the right timer for the same board. Can any of you help me ?
@ari0975 жыл бұрын
The two videos are very useful! Thanks
@babotvoj4 жыл бұрын
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?
@terranceparker201511 ай бұрын
Great video and like your other content and will subscribe.
@KanagachidambaresanGR Жыл бұрын
Great video., you help to print he value in uart. so that i can read the store the value.
@sarbog12 жыл бұрын
Very cool, I implemented this on the STM32F429I-DISC1 Discovery... works great!
@MuhammadAli-ku9dg2 жыл бұрын
Very nicely explained. Just 1 query. Why did you put the process function in while loop and not the half/full routines ?
@sovpadatorvolin3692 жыл бұрын
Why your ProcessData() runs continuously in while(1) loop? Actually it should be executed exactly after each half of adc_val is filled!
@raybuck96754 жыл бұрын
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?
@federicocoppede16814 жыл бұрын
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.
@hardware9944 жыл бұрын
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.
@scsumeetchandra4 жыл бұрын
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?
@johnsaeid955 жыл бұрын
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
@alarmkoguvenlik3 жыл бұрын
You explained great, thank you. Can't we assign the address of the dac memory directly as the adc address, without copying?
@ENGRTUTOR3 жыл бұрын
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.
@nisarggandhi11574 жыл бұрын
Can you upload/share the code for this?
@kaluvanhariharan42565 жыл бұрын
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Ай бұрын
Skonfiguruj MPU lub wyłącz wszystkie ...Cache
@David-nk7pv5 жыл бұрын
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-nk7pv5 жыл бұрын
Nevermind, I found the problem! I had disabled the DMA continuous requests :D
@syedafzal20623 жыл бұрын
@@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
@salehpaz4 жыл бұрын
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?
@ENGRTUTOR4 жыл бұрын
Yes DMA. Thanks for catching this.
@Alan965552 жыл бұрын
How can io change the samplig rate?
@rodrigokea5 жыл бұрын
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.
@franky70254 жыл бұрын
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-wz3hv4 жыл бұрын
Just put a delay of 1ms between HAL_ADC_Start_DMA and HAL_DAC_Start_DMA.
@Marco-wz3hv4 жыл бұрын
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.
@11harinair3 жыл бұрын
@@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.