Skip to main content
OGhis
Senior
Nov 11, 2019 7:55 PM UTC
Question

How using HRTIM as push-pull for the STM32G474

Hi,

Is there anywhere an example how we can use the HRTIM in push-pull mode and how to start the timer?

I had use the following instruction, but the outputs are always low.

HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TE1 | HRTIM_OUTPUT_TE2);
 
HAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_E);

regards

This topic has been closed for replies.

4 replies

Amel NASRI
ST Technical Moderator
Nov 12, 2019 8:20 AM UTC

Hello @OGhis​ ,

Did you looked to the examples available under STM32Cube_FW_G4_V1.1.0\Projects\NUCLEO-G474RE\Examples\HRTIM?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
waclawek.jan
Super User
Nov 12, 2019 9:07 AM UTC

If you talking about the output pin, push-pull or open-dran is selected in the GPIO, not in the peripherals (such as HRTIM).

You also may want to have a look at AN4539 "HRTIM cookbook".

JW

OGhis
OGhisAuthor
Senior
Nov 12, 2019 8:15 PM UTC

I means that i will use the HRTIM for a Push pull power supply topology. (not the GPIO in push-pull mode).

see also RM0440 page 828

like in this schematic:

0690X00000ArxXoQAJ.png

In the CubeMx is there a option for: "Push Pull".

This are the output signals i need:

0690X00000ArxYrQAJ.png

OGhis
OGhisAuthor
Senior
Nov 13, 2019 8:09 PM UTC

I used the following code to start the Timer:

 /* Start HRTIM's TIMER E */
HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TE1);
HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TE2);
HAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_E) ;
 
 
 HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
 HRTIM_TIMERINDEX_TIMER_E,
 HRTIM_OUTPUT_TE1,
 HRTIM_OUTPUTLEVEL_ACTIVE);
 HAL_HRTIM_WaveformSetOutputLevel(&hhrtim1,
 HRTIM_TIMERINDEX_TIMER_E,
 HRTIM_OUTPUT_TE2,
 HRTIM_OUTPUTLEVEL_ACTIVE);

I can see the signal on channel TE1, but the signal on channel TE2 has always a duty cycle of 50%

The set and reset source are configured as follow:

 pOutputCfg.SetSource = HRTIM_OUTPUTRESET_TIMCMP1;
 pOutputCfg.ResetSource = HRTIM_OUTPUTRESET_TIMPER;

And i use only the compare 1 register and the DEADTIME is active between the 2 outputs