cancel
Showing results for 
Search instead for 
Did you mean: 

Running STM32H7 timers at 480Mhz

JLope.11
Associate III

Hello, how can I get timers running at 480Mhz to have maximum resolution?

Here is a capture using latest stmcube version:

stm32.jpg

I have tried D2PRE1 & D2PRE2 

=1 but then warnings appear

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

Hello @JLope.11

No, this frequency is out of range for timers, maximal clock for timers is 240Mhz 

you can use HRTIM for high-resolution that can reach 400 MHz (check Timer resolution and min. PWM frequency Fhrtim in RM ) 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Sarra.S
ST Employee

Hello @JLope.11

No, this frequency is out of range for timers, maximal clock for timers is 240Mhz 

you can use HRTIM for high-resolution that can reach 400 MHz (check Timer resolution and min. PWM frequency Fhrtim in RM ) 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JLope.11
Associate III

I have seen that the HRTIM can be used as independent PWMs (up to 8 lines) at 480Mhz that can give 2ns resolution but cant be used as line and complementary one.

read the rm..

AScha3_0-1702399278072.png

 

If you feel a post has answered your question, please click "Accept as Solution".
JLope.11
Associate III

It is possible to make changes of frequency and duty cycle of a HRTIM without resetting the pwm or introduce glitches?.

To change the period and duty cycle I should do:

  HRTIM_TimeBaseCfgTypeDef pTimeBaseCfg = {0};
  pTimeBaseCfg.Period = 2892;
  if (HAL_HRTIM_TimeBaseConfig(&hhrtim, HRTIM_TIMERINDEX_TIMER_A, &pTimeBaseCfg) != HAL_OK)
  {
    Error_Handler();
  }

  HRTIM_CompareCfgTypeDef pCompareCfg = {0};
  pCompareCfg.CompareValue = 1446;
  if (HAL_HRTIM_WaveformCompareConfig(&hhrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_COMPAREUNIT_1, &pCompareCfg) != HAL_OK)
  {
    Error_Handler();
  }

 

But I do not know if the changes are done in the actual PWM cycle or in the next.

If not, the second option is to  change both at the begin of a cycle (shot by an interruption at the beginning of the timerA)

 

 

>But I do not know if the changes are done in the actual PWM cycle or in the next.

rtfm

AScha3_0-1702460448150.png

 

If you feel a post has answered your question, please click "Accept as Solution".
JLope.11
Associate III

I found it at the stm32cubeide:

preload.jpg

By default it is disabled. 

In other way how to manage the complementary mode?, I have programmed the timer D-1 and 2, if I make push-pull I can not set the dead time. With dead time I do not know if it is connected the timer D-1 with compare unit-1 and timer D-2 to the compare unit 2 and if it is delayed pulse of the D2 automatic 

 

I run the code but no signal is generated. Seems that something must be done to make timers run or activate the lines, something like this but for stm32h7xx:

 

LL_HRTIM_EnableOutput(HRTIM1, LL_HRTIM_OUTPUT_TC1 | LL_HRTIM_OUTPUT_TC2);
/* Start HRTIM's TIMER C */
LL_HRTIM_EnableIT_REP(HRTIM1, LL_HRTIM_TIMER_C);
LL_HRTIM_TIM_CounterEnable(HRTIM1, LL_HRTIM_TIMER_C);

 

Exist an example code?

 

 

see:

AScha3_0-1702552119825.png

so between TA1 and TA2 outputs.

If you feel a post has answered your question, please click "Accept as Solution".