cancel
Showing results for 
Search instead for 
Did you mean: 

TIM3 dual IC in DMA mode issue - only one works

mikael239955_st
Associate II
Posted on October 06, 2016 at 22:20

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
2 REPLIES 2
mikael239955_st
Associate II
Posted on October 06, 2016 at 23:49

Ok I just figured it out. I need to check for completion using HAL_TIM_IC_GetState().. function:

/* USER CODE BEGIN 2 */
HAL_TIM_IC_Start_DMA(&htim3, TIM_CHANNEL_3, risingEdges, 5);
while
(HAL_TIM_IC_GetState(&htim3) == HAL_TIM_STATE_BUSY);
HAL_TIM_IC_Start_DMA(&htim3, TIM_CHANNEL_4, fallingEdges, 5);
while
(HAL_TIM_IC_GetState(&htim3) == HAL_TIM_STATE_BUSY);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
/* USER CODE END 2 */

Now terminal output shows: 40,77,112,149,184,221,256,293,328,365,0,0,0,0,0,0,0,0,0,0, which is alternating positive and negative edge captures as I intended 🙂
Walid FTITI_O
Senior II
Posted on October 10, 2016 at 12:55

Hi stewart.mikael, 

I see that you find out the missed routine. 

Thank you for sharing you knowledge for the good of other users.

-Hannibal-