cancel
Showing results for 
Search instead for 
Did you mean: 

Help with HRTIM UPDATE GATING

MHeid.1
Associate

I have the problem, that the following code does not update the registers.

// The update events, as mentioned below, can be: MSTU, TFU, TEU, TDU, TCU, TBU, TAU, TxRSTU,TxREPU
LL_HRTIM_TIM_SetUpdateGating(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATEGATING_DMABURST_UPDATE);
LL_HRTIM_TIM_SetUpdateTrig(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATETRIG_RESET);

However, if if leave the update event out, it works.

// The update events, as mentioned below, can be: MSTU, TFU, TEU, TDU, TCU, TBU, TAU, TxRSTU,TxREPU
LL_HRTIM_TIM_SetUpdateGating(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATEGATING_DMABURST);
LL_HRTIM_TIM_SetUpdateTrig(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATETRIG_RESET);

And this is the total time code

LL_HRTIM_TIM_SetPrescaler(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_PRESCALERRATIO_MUL32);
LL_HRTIM_TIM_SetCounterMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_MODE_CONTINUOUS);
LL_HRTIM_TIM_SetPeriod(HRTIM1, LL_HRTIM_TIMER_E, 0x4000);
LL_HRTIM_TIM_SetRepetition(HRTIM1, LL_HRTIM_TIMER_E, 0x00);
// The update events, as mentioned below, can be: MSTU, TFU, TEU, TDU, TCU, TBU, TAU, TxRSTU,TxREPU
LL_HRTIM_TIM_SetUpdateGating(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATEGATING_DMABURST);
LL_HRTIM_TIM_SetUpdateTrig(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_UPDATETRIG_RESET);
LL_HRTIM_TIM_SetCountingMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_COUNTING_MODE_UP);
LL_HRTIM_TIM_SetTriggeredHalfMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_TRIGHALF_DISABLED);
LL_HRTIM_TIM_SetComp1Mode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_GTCMP1_EQUAL);
LL_HRTIM_TIM_SetComp3Mode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_GTCMP3_EQUAL);
LL_HRTIM_TIM_SetDACTrig(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_DACTRIG_NONE);
LL_HRTIM_TIM_DisableHalfMode(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_SetInterleavedMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_INTERLEAVED_MODE_DISABLED);
LL_HRTIM_TIM_DisableStartOnSync(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_DisableResetOnSync(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_EnablePreload(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_EnableResyncUpdate(HRTIM1, LL_HRTIM_TIMER_E);
 
LL_HRTIM_TIM_SetResetTrig(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_RESETTRIG_NONE);
LL_HRTIM_TIM_DisablePushPullMode(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_EnableDeadTime(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_SetBurstModeOption(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_BURSTMODE_MAINTAINCLOCK);
LL_HRTIM_ForceUpdate(HRTIM1, LL_HRTIM_TIMER_E);
LL_HRTIM_TIM_SetCompare1(HRTIM1, LL_HRTIM_TIMER_E, 0x1000);
LL_HRTIM_TIM_SetCompareMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_COMPAREUNIT_2, LL_HRTIM_COMPAREMODE_REGULAR);
LL_HRTIM_TIM_SetCompare2(HRTIM1, LL_HRTIM_TIMER_E, 0x2000);
LL_HRTIM_TIM_SetCompare3(HRTIM1, LL_HRTIM_TIMER_E, 0x3000);
LL_HRTIM_TIM_SetCompare4(HRTIM1, LL_HRTIM_TIMER_E, 0x4000);
LL_HRTIM_TIM_SetCompareMode(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_COMPAREUNIT_4, LL_HRTIM_COMPAREMODE_REGULAR);
LL_HRTIM_TIM_ConfigBurstDMA(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_BURSTDMA_TIMPER|LL_HRTIM_BURSTDMA_TIMCMP1
	                              |LL_HRTIM_BURSTDMA_TIMCMP2|LL_HRTIM_BURSTDMA_TIMCMP3
	                              |LL_HRTIM_BURSTDMA_TIMCMP4);
LL_HRTIM_DT_SetPrescaler(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_DT_PRESCALER_MUL8);
	  LL_HRTIM_DT_SetRisingValue(HRTIM1, LL_HRTIM_TIMER_E, 0x010);
	  LL_HRTIM_DT_SetRisingSign(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_DT_RISING_POSITIVE);
LL_HRTIM_DT_SetFallingValue(HRTIM1, LL_HRTIM_TIMER_E, 0x010);
LL_HRTIM_DT_SetFallingSign(HRTIM1, LL_HRTIM_TIMER_E, LL_HRTIM_DT_FALLING_POSITIVE);
LL_HRTIM_OUT_SetPolarity(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUT_POSITIVE_POLARITY);
LL_HRTIM_OUT_SetOutputSetSrc(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUTPUTSET_TIMCMP1);
LL_HRTIM_OUT_SetOutputResetSrc(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUTPUTRESET_TIMCMP4);
LL_HRTIM_OUT_SetIdleMode(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUT_NO_IDLE);
LL_HRTIM_OUT_SetIdleLevel(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUT_IDLELEVEL_INACTIVE);
LL_HRTIM_OUT_SetFaultState(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUT_FAULTSTATE_NO_ACTION);
LL_HRTIM_OUT_SetChopperMode(HRTIM1, LL_HRTIM_OUTPUT_TE1, LL_HRTIM_OUT_CHOPPERMODE_DISABLED);
LL_HRTIM_OUT_SetPolarity(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUT_POSITIVE_POLARITY);
LL_HRTIM_OUT_SetOutputSetSrc(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUTPUTSET_NONE);
LL_HRTIM_OUT_SetOutputResetSrc(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUTPUTRESET_NONE);
LL_HRTIM_OUT_SetIdleMode(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUT_NO_IDLE);
LL_HRTIM_OUT_SetIdleLevel(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUT_IDLELEVEL_INACTIVE);
LL_HRTIM_OUT_SetFaultState(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUT_FAULTSTATE_INACTIVE);
LL_HRTIM_OUT_SetChopperMode(HRTIM1, LL_HRTIM_OUTPUT_TE2, LL_HRTIM_OUT_CHOPPERMODE_DISABLED);

In CubeMX the Update gateing is also grey and i cannot select it. I did not find a solution to enable it.

Please help, how do I enable the update gating with DMA?

1 REPLY 1
Khouloud ZEMMELI
ST Employee

Hello @Community member​ 

You cannot select any mode under update gating ? or there's a specific mode grayed ?

Could you please share your ioc file ?

Thanks

Khouloud