cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H750VBT HRTIM not working

JLope.11
Associate III

I cant make work the HRTIM. I am using the weact board.

I tried HRTIM-A and TRTIM-D using the cubeide (latest updated). the first one using "basic HAL" and the second using "Advanced Hal" instructions

TIM5 works so it seems that clock is working.

I added following code to make run the timers and the debugger passed them without trouble:

  MX_HRTIM_Init();
  if(  HAL_HRTIM_WaveformOutputStart(&hhrtim, HRTIM_OUTPUT_TD1)!= HAL_OK)
	{
		Error_Handler();
	}
  if (HAL_HRTIM_WaveformOutputStart(&hhrtim, HRTIM_OUTPUT_TD2)!= HAL_OK)
	{
		Error_Handler();
	}
  if (HAL_HRTIM_WaveformCountStart_IT(&hhrtim, HRTIM_TIMERID_TIMER_D)!= HAL_OK)
	{
		Error_Handler();
	}
  if (HAL_HRTIM_WaveformCounterStart(&hhrtim, HRTIM_TIMERID_TIMER_D)!= HAL_OK)
	{
		Error_Handler();
	}
  if (  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim,
                                   HRTIM_TIMERINDEX_TIMER_D,
                                   HRTIM_OUTPUT_TD1,
                                   HRTIM_OUTPUTLEVEL_ACTIVE)!=HAL_OK)
  	{
	Error_Handler();
	}
	if (  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim,
                                   HRTIM_TIMERINDEX_TIMER_D,
                                   HRTIM_OUTPUT_TD2,
                                   HRTIM_OUTPUTLEVEL_ACTIVE)!=HAL_OK)
		{
		Error_Handler();
	}
  if (HAL_HRTIM_WaveformCountStart_IT(&hhrtim, HRTIM_TIMERID_TIMER_D)!= HAL_OK)
	{
		Error_Handler();
	}

  if (HAL_HRTIM_WaveformCounterStart(&hhrtim, HRTIM_TIMERID_TIMER_A)!= HAL_OK)
	{
		Error_Handler();
	}
  if (  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA1,
                                   HRTIM_OUTPUTLEVEL_ACTIVE)!=HAL_OK)
  	{
	Error_Handler();
	}
	if (  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA2,
                                   HRTIM_OUTPUTLEVEL_ACTIVE)!=HAL_OK)
		{
		Error_Handler();
	}

Here are the configurations of the cubeide:

TIMER-D configuration:

Advanced.jpg

TIMER-A configuration:

Basic.jpg

MASTER TIMER CONFIGURATION:

 

Master.jpg

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JLope.11
Associate III

After making this:

 

HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA1);
HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA2);
HAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_A) ;
 
 
  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA1,
                                   HRTIM_OUTPUTLEVEL_ACTIVE);
  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA2,
                                   HRTIM_OUTPUTLEVEL_ACTIVE);

 Worked the Timer A1 but not the A2, that is due Weact board uses  the HRTIM legs to connect to USB ,camera, display. I recommend build a custom board.

View solution in original post

1 REPLY 1
JLope.11
Associate III

After making this:

 

HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA1);
HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA2);
HAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_A) ;
 
 
  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA1,
                                   HRTIM_OUTPUTLEVEL_ACTIVE);
  HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
                                   HRTIM_TIMERINDEX_TIMER_A,
                                   HRTIM_OUTPUT_TA2,
                                   HRTIM_OUTPUTLEVEL_ACTIVE);

 Worked the Timer A1 but not the A2, that is due Weact board uses  the HRTIM legs to connect to USB ,camera, display. I recommend build a custom board.