Skip to main content
Natan Stec
Associate II
May 25, 2018
Question

Multiple channels input capture at the same time

  • May 25, 2018
  • 7 replies
  • 2011 views
Posted on May 25, 2018 at 11:27

Hello, I'd like to know if there is possibility to use all input capture channels at the same time?

For starting timer i use function wich enable only 1 channel:

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_1, &restWave[0], 1);

I'd like to use something like this (but obviously it doesn't work)

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_ALL, restWave, 4);

And it doesn't work as well:

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_1, &restWave[0], 1);

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_2, &restWave[1], 1);

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_3, &restWave[2], 1);

HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_4, &restWave[3], 1);

    This topic has been closed for replies.

    7 replies

    Khouloud GARSI
    ST Employee
    May 25, 2018
    Posted on May 25, 2018 at 12:02

    Hi

    steca

    ‌,

    Could you precise which STM32 device you're using.

    Khouloud.

    Natan Stec
    Associate II
    May 25, 2018
    Posted on May 25, 2018 at 12:04

    STM32F303

    Khouloud GARSI
    ST Employee
    June 4, 2018
    Posted on June 04, 2018 at 14:30

    Hi

    ‌,
    1. Using'HAL_TIM_IC_Start_DMA' , the first configuration is not allowed.

      HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_ALL, restWave, 4);�?

    2. Try to force the state toHAL_TIM_STATE_READY after each function call:

    HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_1, &restWave[0], 1);htim1.State = HAL_TIM_STATE_READY;HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_2, &restWave[1], 1);htim1.State = HAL_TIM_STATE_READY;HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_3, &restWave[2], 1);htim1.State = HAL_TIM_STATE_READY;HAL_TIM_IC_Start_DMA(&htim1, TIM_CHANNEL_4, &restWave[3], 1);htim1.State = HAL_TIM_STATE_READY;�?�?�?�?�?�?�?�?

    I'm waiting for your feedback

    Khouloud.

    henry.dick
    Associate II
    June 4, 2018
    Posted on June 04, 2018 at 18:00

    '

    if there is possibility to use all input capture channels at the same time?'

    Yes assuming that pin configuration isn't a challenge.