STM32 HRTIM dead-time generator breaks with fast (async) external event mode - Page 1
Forum section: electronics / projects

author: uer166
author_rank: Super Contributor
timestamp: November 06, 2020, 04:01:08 am
content: Well, there goes my detailed post, eaten up by a forum bug. Anyway, has anyone used the dead-time generator in HRTIM here? I have a quick-and-dirty hysteretic constant current controller with 2 comparators and 2 DACs, feeding the HRTIM events EEV1 and EEV4. The HRTIM timer A outputs are set to be complementary with dead-time.Now, the relevant dead-time setup code is:Code:pDeadTimeCfg.Prescaler = HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8;pDeadTimeCfg.RisingValue = 511;pDeadTimeCfg.RisingSign = HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE;pDeadTimeCfg.RisingLock = HRTIM_TIMDEADTIME_RISINGLOCK_READONLY;pDeadTimeCfg.RisingSignLock = HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE;pDeadTimeCfg.FallingValue = 511;pDeadTimeCfg.FallingSign = HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE;pDeadTimeCfg.FallingLock = HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY;pDeadTimeCfg.FallingSignLock = HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE;if (HAL_HRTIM_DeadTimeConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_A, &pDeadTimeCfg) != HAL_OK){Error_Handler();}This is almost exactly the same as ST's synchronous buck example. Above didn't work initially and caused some waveform overlap on the falling edge, see the attached screenshot. If I replaced this:Code:pEventCfg.FastMode = HRTIM_EVENTFASTMODE_ENABLE;With this:Code:pEventCfg.FastMode = HRTIM_EVENTFASTMODE_DISABLE;Suddenly it worked as expected.I realize there are limitation in using async inputs, but I am unable to find anything relating lack of dead-time generation and using external events asynchronously in the reference manual. So, anyone has any ideas? I wouldlikemy inputs to not have the 6-7 clock re-synchronization latency, if at all possible.

author: Miyuki
author_rank: Frequent Contributor
timestamp: November 06, 2020, 10:03:31 am
content: Why just not use two timers and generate signal with delay at leading edge?I don't say it is a clean solution, but can be much easier to debug.At event 11st timer start with leading edge delay2nd timer stop instantlyAt event 22nd timer start with leading edge delay1st timer stop instantly

author: uer166
author_rank: Super Contributor
timestamp: November 06, 2020, 07:20:04 pm
content: That's another way to achieve same result with twice the resources. If a feature is available that I like, it should be possible to use itThe HRTIM seems one of the more badly documented IPs. A lot of words, yet not enough detail.

author: uer166
author_rank: Super Contributor
timestamp: November 08, 2020, 02:58:05 am
content: Some other potentially fatal issue found, when initially preloading/forcing the output to be in a certain state viaCode:hhrtim1.Instance->sTimerxRegs.RSTx1R = HRTIM_RST1R_SRTAs per reference manual.For whatever reason, it makes it insensitive to the real external events it's supposed to switch on, ignoring comparator outputs and such. It's almost as if the initial output set or reset did something to the original set/reset crossbar configuration. Is there an errata for this POS peripheral somewhere? With so much complexity, it for sure has at least one problem, bit neither the MCU errata, nor searching yields one.

author: nuclearcat
author_rank: Unknown
timestamp: November 08, 2020, 08:25:12 am
content: You didn't mentioned yet specific STM32 model you are using.

author: uer166
author_rank: Super Contributor
timestamp: November 08, 2020, 07:19:57 pm
content: Sorry that would be STM32G474.

author: sanmu
author_rank: Newbie
timestamp: March 13, 2024, 10:13:05 am
content: hello，I encountered the same problem as you，can you tell me how you solved this problem? i need fast (async) external event mode to control a current controlled high frequency converter