AnsweredAssumed Answered

DMA triggering not running for an input capture timer channel

Question asked by joee on Oct 31, 2012
Latest reply on Oct 31, 2012 by joee
I want to capture a systick time by occurence of an edge. I see the value is captured but the DMA is not done. Why? (STM32F4)

TIM_ICInitTypeDef   TIM_ICInitStructure;
     
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE);
     
    DMA_InitTypeDef DMA_InitStructure;
     
    DMA_DeInit(DMA1_Stream0);
     
    DMA_InitStructure.DMA_Channel = DMA_Channel_2; 
    DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&SysTick->VAL ;
    DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)×tampOfEncoderEdge;
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
    DMA_InitStructure.DMA_BufferSize = 1;
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
    DMA_InitStructure.DMA_MemoryDataSize = DMA_PeripheralDataSize_Word;
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;
    DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
    DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
    DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
    DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
 
    DMA_Init(DMA1_Stream0, &DMA_InitStructure);
 
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);
   TIM_DeInit(TIM4);
 
   TIM_ICInitStructure.TIM_Channel      = TIM_Channel_1;           
   TIM_ICInitStructure.TIM_ICPolarity   = TIM_ICPolarity_BothEdge;
   TIM_ICInitStructure.TIM_ICSelection    = TIM_ICSelection_DirectTI;  
   TIM_ICInitStructure.TIM_ICPrescaler    = TIM_ICPSC_DIV1;        
   TIM_ICInitStructure.TIM_ICFilter         = 0x0; 
   TIM_ICInit(TIM4, &TIM_ICInitStructure);
 
    TIM_Cmd(TIM4, ENABLE);
 
    DMA_Cmd(DMA1_Stream0, ENABLE);
     
    TIM_DMACmd(TIM4, TIM_DMA_CC1, ENABLE);

Outcomes