AnsweredAssumed Answered

The DMA interrupt is different between ADC and DAC

Question asked by qiyong.mu.001 on Oct 6, 2016
Latest reply on Oct 7, 2016 by FTITI.Walid
NUCLEO-F746ZG
I'm testing the ADC and DAC work with DMA, but the interrupt is different:
the DMA of ADC can enter interrupt when Half and Full transfer.
But the DMA of DAC only interrupt when Half transfer.

Timer tmr;
DigitalOut Dac_Event(PB_1);

static int tinterval;
void DMA2_Stream0_IRQHandler(void)//ADC DMA
{
    /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */
    tim4cnt++;
    if(__HAL_DMA_GET_IT_SOURCE(&DMA_ADC_Handle, DMA_IT_HT)) { //Half transfer
        tinterval = tmr.read_us();//Half DMA
        HAL_DMA_IRQHandler(&DMA_ADC_Handle);
        return;
    }
    if(__HAL_DMA_GET_IT_SOURCE(&DMA_ADC_Handle, DMA_IT_TC))//Full transfer
    {
        tinterval=tmr.read_us() - tinterval;
           HAL_DMA_IRQHandler(&DMA_ADC_Handle);
    }
}
void DMA1_Stream6_IRQHandler(void)////DAC DMA DMA1_Stream6
{
    /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */
    if(__HAL_DMA_GET_IT_SOURCE(&DMA_DAC_Handle, DMA_IT_HT)) { //Half transfer
        Dac_Event = 1;
        HAL_DMA_IRQHandler(&DMA_DAC_Handle);
        return;
    }
    if(__HAL_DMA_GET_IT_SOURCE(&DMA_DAC_Handle, DMA_IT_TC)) { //Full transfer not enter
        Dac_Event = 0;
        HAL_DMA_IRQHandler(&DMA_DAC_Handle);
    }
}

Outcomes