2023-12-11 05:54 AM
Hello, how can I get timers running at 480Mhz to have maximum resolution?
Here is a capture using latest stmcube version:
I have tried D2PRE1 & D2PRE2
=1 but then warnings appear
Solved! Go to Solution.
2023-12-11 06:43 AM
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.
2023-12-11 06:43 AM
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.
2023-12-12 08:15 AM
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.
2023-12-12 08:43 AM
read the rm..
2023-12-13 12:51 AM - edited 2023-12-13 12:59 AM
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)
2023-12-13 01:40 AM
>But I do not know if the changes are done in the actual PWM cycle or in the next.
rtfm
2023-12-14 12:58 AM - edited 2023-12-14 02:09 AM
I found it at the stm32cubeide:
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?
2023-12-14 03:10 AM
see:
so between TA1 and TA2 outputs.