Tutorial STM32 DAC Timer Triggered DMA

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

ความคิดเห็น • 29

  • @PalczakWombiasty
    @PalczakWombiasty 5 หลายเดือนก่อน

    Amazing video, thank you. Finally somebody explained this subject, so even I can understand it :)

    • @prtechtalk416
      @prtechtalk416  5 หลายเดือนก่อน +1

      Thanks for your kind words. Great that you learned something. /PR TechTalk

  • @capistor1
    @capistor1 2 หลายเดือนก่อน +1

    Thanks for such a detailed video!

    • @prtechtalk416
      @prtechtalk416  หลายเดือนก่อน

      Glad you enjoyed it! / PR TechTalk

  • @GuadrianBM
    @GuadrianBM หลายเดือนก่อน +1

    Hello Sir I am trying to use multiple DAC to produce two sine waves of different frequencies. I am not able to do it. Can you help me with this?

    • @prtechtalk416
      @prtechtalk416  หลายเดือนก่อน

      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

  • @psycox8758
    @psycox8758 2 หลายเดือนก่อน +1

    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 ;)

    • @prtechtalk416
      @prtechtalk416  หลายเดือนก่อน

      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

    • @psycox8758
      @psycox8758 หลายเดือนก่อน +1

      I subbed immediately after watching the video 👍

  • @ValerioFazzi
    @ValerioFazzi 6 หลายเดือนก่อน

    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

    • @prtechtalk416
      @prtechtalk416  6 หลายเดือนก่อน

      Hi, Sorry but i do not have resources to offer this kind of software support, hope you will succeed anyway.

  • @LarsBgildThomsen
    @LarsBgildThomsen 20 วันที่ผ่านมา

    The math.h library includes M_PI already

    • @prtechtalk416
      @prtechtalk416  14 วันที่ผ่านมา

      Hi, i am not sure if that M_PI is included as standard.
      /PR TechTalk

  • @AndreaBasilico-eo4pl
    @AndreaBasilico-eo4pl 3 หลายเดือนก่อน +1

    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

    • @prtechtalk416
      @prtechtalk416  3 หลายเดือนก่อน +1

      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

    • @prtechtalk416
      @prtechtalk416  3 หลายเดือนก่อน +1

      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

    • @AndreaBasilico-eo4pl
      @AndreaBasilico-eo4pl 3 หลายเดือนก่อน +1

      @@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

  • @codures
    @codures 8 หลายเดือนก่อน

    12:00 sir please accept my apologies, but your pi is not good.

    • @prtechtalk416
      @prtechtalk416  8 หลายเดือนก่อน

      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

    • @codures
      @codures 8 หลายเดือนก่อน

      @@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!

    • @prtechtalk416
      @prtechtalk416  8 หลายเดือนก่อน

      Haha i didn’t even notice this typo. I Think you are equipped with Hawkeyes 😁
      Thanks for the comments and corrections.
      /PR TechTalk

  • @edgarwcl
    @edgarwcl 6 หลายเดือนก่อน

    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!

    • @prtechtalk416
      @prtechtalk416  6 หลายเดือนก่อน

      Hi, No you cant modulate the output swing from the STM32. If you need lower swing an easy way is to use resistor divider and a buffer

  • @antonioriccelli7932
    @antonioriccelli7932 6 หลายเดือนก่อน

    if i want to reach a 300Khz with DAC with 32 point of sinus table wich evaluation board is necessary?

    • @prtechtalk416
      @prtechtalk416  6 หลายเดือนก่อน +1

      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.

  • @nimaaskari-d2i
    @nimaaskari-d2i 5 หลายเดือนก่อน

    I have a problem. My Transfer interrupt calls 2 steps before done the buffer. what is happening? i am using stm32u575ri

    • @prtechtalk416
      @prtechtalk416  4 หลายเดือนก่อน

      Hi, that is impossible to answer need to see whole project to being able to respond,

    • @nimaaskari-d2i
      @nimaaskari-d2i 4 หลายเดือนก่อน

      @@prtechtalk416 how to send you the project?

    • @nimaaskari-d2i
      @nimaaskari-d2i 4 หลายเดือนก่อน

      @@prtechtalk416 but you can try. please enable dma interrupt toggle a pin. i have tried with G4 and U5.