Skip to main content
JLope.11
Associate III
December 11, 2023
Solved

Running STM32H7 timers at 480Mhz

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

This topic has been closed for replies.
Sarra.SBest answer
ST Employee
December 11, 2023

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.

7 replies

Sarra.SBest answer
ST Employee
December 11, 2023

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
JLope.11Author
Associate III
December 12, 2023

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.

AScha.3
Super User
December 12, 2023

read the rm..

AScha3_0-1702399278072.png

 

If you feel a post has answered your question, please click on " Best Answer ".
JLope.11
JLope.11Author
Associate III
December 13, 2023

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)

 

 

AScha.3
Super User
December 13, 2023

>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 on " Best Answer ".
JLope.11
JLope.11Author
Associate III
December 14, 2023

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?

 

 

AScha.3
Super User
December 14, 2023

see:

AScha3_0-1702552119825.png

so between TA1 and TA2 outputs.

If you feel a post has answered your question, please click on " Best Answer ".