cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G474RE HRTIM CBC example

Manu Abraham
Senior

Hi All,

I am looking at the HRTIM CBC example here:

https://github.com/STMicroelectronics/STM32CubeG4/blob/master/Projects/NUCLEO-G474RE/Examples_LL/HRTIM/HRTIM_CBC_Deadtime/Src/main.c

The questions are centred around EE5 and EE8 external inputs.

I have 2 questions, that probably someone can clear my understanding.

(1) EE8 is available only with PB8, but PB8 s used for the Boot configuration (P88 is pulled down via a resistor to boot from Flash)How is the situation handled ?

(2) As per the resource manual, I understand that EE5 is not associated with a filter and is thus considered a Fast channel.

Around line#246:

  LL_HRTIM_EE_SetSrc(HRTIM1, LL_HRTIM_EVENT_5, LL_HRTIM_EEV5SRC_GPIO);
  LL_HRTIM_EE_SetPolarity(HRTIM1, LL_HRTIM_EVENT_5, LL_HRTIM_EE_POLARITY_HIGH);
  LL_HRTIM_EE_SetSensitivity(HRTIM1, LL_HRTIM_EVENT_5, LL_HRTIM_EE_SENSITIVITY_LEVEL);
  LL_HRTIM_EE_SetFastMode(HRTIM1, LL_HRTIM_EVENT_5, LL_HRTIM_EE_FASTMODE_DISABLE);

As a result, the Fast mode option appears to be disabled.

Around line#250:

LL_HRTIM_EE_SetSrc(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EEV8SRC_GPIO);
LL_HRTIM_EE_SetPolarity(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EE_POLARITY_HIGH);
LL_HRTIM_EE_SetSensitivity(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EE_SENSITIVITY_BOTHEDGES);
LL_HRTIM_EE_SetFilter(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EE_FILTER_NONE)

EEV8 Filter appears to be disabled, but at line#282 the EEV8 Filter seems to applied:

LL_HRTIM_TIM_SetCaptureTrig(HRTIM1, LL_HRTIM_TIMER_D, LL_HRTIM_CAPTUREUNIT_1, LL_HRTIM_CAPTURETRIG_EEV_8);
LL_HRTIM_TIM_SetCaptureTrig(HRTIM1, LL_HRTIM_TIMER_D, LL_HRTIM_CAPTUREUNIT_2, LL_HRTIM_CAPTURETRIG_EEV_8);
LL_HRTIM_TIM_SetEventFilter(HRTIM1, LL_HRTIM_TIMER_D, LL_HRTIM_EVENT_8, LL_HRTIM_EEFLTR_BLANKINGCMP1);

Question 2a) :Why is the Filter disabled and then enabled later ?

Now, both events are used to Reset the output waveform at Line#288

LL_HRTIM_OUT_SetOutputResetSrc(HRTIM1, LL_HRTIM_OUTPUT_TD1, LL_HRTIM_OUTPUTRESET_TIMCMP3|LL_HRTIM_OUTPUTRESET_EEV_5
                              |LL_HRTIM_OUTPUTRESET_EEV_8);

Question 2b):

Both External events (pins PB8 & PB9) are tied together; PB5 is Level triggered while PB8 is edge triggered. Both of them are used to Reset the Output PWM. What is the need to use both EEV5 and EE8. I am trying to understand the methodology in there.

Can someone bring n a bit of clarification ?

Thanks,

Manu

1 REPLY 1
Manu Abraham
Senior

Any thoughts/suggestions ?

Thanks,

Manu