cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid unexpected TRGO/TRGO2 signals at the timer initialize stage?

lafa
Associate II

In STM32H7B0xxx platform, I use TIM8's TRGO2 to trigger ADC2 converstion.

In the MX_TIM8_Init() function, it will generate an update event and fire a TRGO signal unexpected before TRGO2 source initialize.

5 REPLIES 5
TDK
Guru

An update event is generated during initialization to ensure the PSC register is refreshed. Since the default TRGO output is tied to the update event, you get a TRGO event. This happens within HAL_TIM_Base_Init(). If you don't want this, you'll need to do your own timer initialization.

If you feel a post has answered your question, please click "Accept as Solution".
lafa
Associate II

Thank you very much.

After tracing the HAL code, I find that at the time of software generate update event, all the trigger sources are in HW reset state. TRGO/TRGO2 trigger event sources have not been configured but trigger signal exist on TRGO/TRGO2.

I want to know who generate it ? how to avoid?

lafa
Associate II

Only initialized timer Clock Division,ARR, counter mode, then raise an update event, I get TRGO/TRGO2 trigger.

> all the trigger sources are in HW reset state

0693W00000GY3CWQA1.png 

JW

Got it. Thanks a lot.

It means at the HW reset state, timer will generate TRGO signal whenever by UG event.