cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F334 HRTIM fails randomly

RUBEN GUTIERREZ
Associate
Posted on June 29, 2018 at 10:34

Hello.

I am using the STM32F334R8T7 in a design of a 3 phase buck converter.

I have noticed that sometimes the HRTIM miss the reset event on the PWM (reset means put the output to 0).

The frequency is 400kHz (0x2D00 loaded in timer A, B, C and Master). The MCU frequency is 72MHz and the HRTIM resolution is the maximum available 217ps.

The master timer is used to generate the 120º phase shift between phases. It restarts timer A when the master reaches 0x70, timer B at 0x0F70, timer C at 0x1E70. The same event from the master sets the output of each timer to start a new PWM cycle. The reset is generated with the CMP1 of each timer and depends on the duty cycle needed.

Each timer (A, B and C) is for one converter's phase.

There is one injected acquisition event in the ADC2 at the 10% of each timer (0x480) with CMP2.

There is one injected acquisition event in the ADC1 at the 10% of timer A.

There are interrupts when the ADC1 ends the acquisitions and three comparators to shut down the PWM on an overcurrent event.

As an example if I fix the Duty cycle to a 20% (around 0x900) in every timer sometimes in one channel A, B or C the reset event is missed and the PWM is over the 100% until a new reset event is generated in the next cycle.

If I use another Comparator like CMP3 to generate a new reset event at DUTY+0x70 then this event is rarely produced but sometimes happens again, and I have to put another reset in CMP4 at Duty+0x70*2.

I also noticed that this problem goes away or at least happens fewer times if I remove some events in the HRTIM. Example: Not use the HRTIM events for start the ADC acquisitions or not use the Master timer. I seems like the HRTIM sometimes is overloaded and miss some events.

I hope someone can help to find where the problem could be or what I’m doing in the wrong way to make a reliable converter. Thank you everyone.

0 REPLIES 0