cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 DAC External Trigger on Falling Edge

FFunk.2
Associate II

Hi,

I would like the apply the DAC values of my STM32H723 together with an external event (external trigger). This event is a falling edge.

Is this possible at all? The problem is: No matter how I configure the EXTI line (falling or rising), the DAC values are always applied on the rising edge.

What I did is setting up the EXTI on the corresponding pin to detect falling edges and then using the DAC EXTI trigger.

    // Configure External Trigger
    LL_SYSCFG_SetEXTISource(LL_SYSCFG_EXTI_PORTA, LL_SYSCFG_EXTI_LINE9);
    EXTI_InitStruct.Line_0_31   = LL_EXTI_LINE_9;
    EXTI_InitStruct.Line_32_63  = LL_EXTI_LINE_NONE;
    EXTI_InitStruct.Line_64_95  = LL_EXTI_LINE_NONE;
    EXTI_InitStruct.LineCommand = ENABLE;
    EXTI_InitStruct.Mode        = LL_EXTI_MODE_IT;
    EXTI_InitStruct.Trigger     = LL_EXTI_TRIGGER_FALLING;
    LL_EXTI_Init(&EXTI_InitStruct);
    LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_9, LL_GPIO_MODE_INPUT);
    LL_GPIO_SetPinPull(GPIOA, LL_GPIO_PIN_9, LL_GPIO_PULL_NO);
    // Use DAC external trigger
    DAC_InitStruct.TriggerSource = LL_DAC_TRIG_EXT_EXTI_LINE9;

Regards,

Frederik

2 REPLIES 2
RBENF.1
ST Employee

Hello @FFunk.2​ 

Indeed, when using DAC with external event trigger, only a rising edge will be detected on the selected source. This is stated in RM0468 section 31.4.7 

Best regards,

Ryan

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

FFunk.2
Associate II

Hi @RBENF.1​ ,

thanks for the answer. Yes, I saw this section. But I thought it works that way:

A signal arrives on the external pin. Then you configure the EXTI controller for a specific event (in my case a falling edge detection). And as soon as the EXTI detects this, it will give a rising edge to the DAC as trigger.

Isn't this working in that way? Is the external input propagated directly to the DAC without involving the GPIO EXTI controller?

Best regards,

Frederik