Excellent tutorial! Thanks. I found that the higher sample waveforms look clipped on the scope but can be scaled to avoid clipping by changing line 75 to... sine_val[i] =((sin(i*2*pi/MAX_SAMPLES)+1.1)) * res_12b / 2.2; Not sure if that's the proper way to do it but it works ;)
Thanks, greate you did put this in the comment so many other can benefit also from your findings, PLs dont forget to hit the Subscribe button also :-) / PR TechTalk
Hi, i am Sorry but i do not have bandwidth to write customer code, have you checked with a site called Fiverr.com their are several freelancers for varius tasks and also STM32 Coding. Good Luck. /Pr TechTalk
hello! i have a question , is it possible to have a interrupt when the DMA is at the middle and at the end of the buffer? to "refill" the buffer with new value taked from external memory or calculated. Also is it possible to use the DMA to feed a pwm duty cycle ? thankyou for the awesome videos! best reguards
Hi Andrea, Sure you can get half full interrupt also. Test this code: void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) { if (hadc->Instance == ADC1) { // Handle half buffer full interrupt } } Good Luck /Peter Ranemyr
Sorry missed their was 2 questions. Also yes on this question, you can direct the DMA result from ADC directly to TIM1_CCR1 ( for tim1) Good Luck /PR TechTalk
@@prtechtalk416 Hi! i think this is for a ADC conversion, in this video we are using DAC , so its equal for memory to periferal direction? thank you for your kind responce
Nice lecture. May I ask two questions? Q1: Can the output amplitude be control (For example: Out swings only 2vpp)? Q2: Can generate the sine wave with offset (For example: +0.3v)? . Hopefully, you can help, thanks!
Hello and thank you for the video. I'm developing the same project for audio purposes. I am now facing problems on changing the values of the DAC while the program is running. If I use const values or if I set the DAC buffer before the while(1), all good. After that, the buffer doesn't get the correct values. Can you help me out? thanks in advance
I haven’t made the calculation but if you want high resolution and fast signal you need a fast clock. Some devices have a HR Timer. Take a look at STM32G474.
Hi Codures. Firstly no one need to apologise for having a stament of any sort. But i was thinking of what your concern, is it that do not have enough decimals or the way i bluntly set pi using a #define. Since i have included math.h i could also declare pi as " double pi = M_PI; " Or if i miss your point totaly pls clarify so we all can learn. /PR TechTalk
@@prtechtalk416 the pun was intended, because there was a typo in the π decimals (3.1415 *5* 926). On the programming side, given the number of samples, even float would work with a π=3.1416. I just discovered your videos the other day, they are really awesome!