Skip to main content
Andrei Gheorghiu
Associate II
October 6, 2017
Question

Sinus generator

  • October 6, 2017
  • 3 replies
  • 1304 views
Posted on October 06, 2017 at 16:58

Hello, i have to make  a Sinus Generator can you please give me any hint or a gide how to start ?

Thank you.

    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    October 6, 2017
    Posted on October 06, 2017 at 17:41

    Think I've previously demonstrated a TIM+DMA+DAC example feeding a sine wave table to the DAC at a defined pace.

    Circular DMA on buffer

    Triggered via a TIM at frequency X table length

    DMA copies to DAC->DR

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Andrei Gheorghiu
    Associate II
    October 8, 2017
    Posted on October 08, 2017 at 16:24

    Hello again SIr,

    Can you please send me a link with this example ?

    Thank you verry much

    Tesla DeLorean
    Guru
    October 8, 2017
    Posted on October 08, 2017 at 19:00

    https://community.st.com/0D50X00009XkiK9SAJ

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Andrei Gheorghiu
    Associate II
    October 18, 2017
    Posted on October 18, 2017 at 20:02

    Hello Clive,

    I am i am stuck at a step in the code,

    How can i make the DMA to allow 2 octet only for every IRQ from TIM5

    To send to an external DAC.

    Below is a link with my current project ,

    https://drive.google.com/file/d/0B7fbIHd58fTedUtjVDBYajg4MUk/view?usp=sharing

    Thank you for your support,

    Best Regards,

    Andrei

    Tesla DeLorean
    Guru
    October 18, 2017
    Posted on October 18, 2017 at 20:22

    Really can't provide assistance with HAL code, you'd want to avoid placing blocking code in the IRQ Handler.

    You might be better using a memory transfer to the SPI->DR in 16-bit mode using DMA triggered by a TIM on the same APB. ie not use a direct SPI+DMA linkage where SR.TXE drives the DMA service.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..