cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple channels input capture at the same time

Natan Stec
Associate II
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);

7 REPLIES 7
Khouloud GARSI
Lead II
Posted on May 25, 2018 at 12:02

Hi

steca

‌,

Could you precise which STM32 device you're using.

Khouloud.

Posted on May 25, 2018 at 12:04

STM32F303

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
Senior II
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.

Posted on June 11, 2018 at 15:53

It seems to work  

Thank you Khouloud very much for your time

Posted on June 11, 2018 at 16:00

You're welcome

Posted on June 11, 2018 at 22:15

khouloud,

This is pretty interesting! 

But i have trouble understanding what timer state not ready means, if i am allow to override it so i can start something else that checks it! \

When am i supposed to assume it is busy means busy and when am i allow to ignore/override it?

Maybe you flush out the details here and are there another cases where this is applicable?