cancel
Showing results for 
Search instead for 
Did you mean: 

How using HRTIM as push-pull for the STM32G474

OGhis
Senior

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

4 REPLIES 4
Amel NASRI
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

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
Senior

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
Senior

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