cancel
Showing results for 
Search instead for 
Did you mean: 

General Purpose Timers: what are the options for One-Pulse slave mode trigger?

eBirdman
Senior

I am using STM32H7 General Purpose Timers TIM2, TIM3, TIM4, TIM5 and their respective external trigger ETR using combined RESET and TRIGGER modes and I am configuring and starting Channel4 for each to generate One-Pulse output .

All the configuration and startup steps followed, Base counter started, Channels started but It does not work.

All the One-Pulse examples I found in STM app notes and on-line examples show only one case of the Timer slave mode for One-Pulse generation: using the TI1FP1 or TI2FP2 inputs from the channel pins. Not ETR, not ITx examples , but only those two.

I suspect that only these inputs triggers are allowed for the Timer One-Pulse mode but the user manual on One-Pulse Ch. 39.3.13 fails to mention that.

User guide for STM32H7 One-pulse mode Ch. 39.3.13 states:

Starting the counter can be controlled through the slave mode controller.

No limitations have been mentioned regarding the trigger choice for the Timer slave mode , although Chapters on General Purpose timers describe different types of possible external and internal triggers, including external trigger ETR

So the question is: can ETR trigger be used to reset and trigger the internally clocked timer counter and generate One-Pulse channel output?

1 ACCEPTED SOLUTION

Accepted Solutions
eBirdman
Senior

I came back to provide the answer to my question for those who may have the same problem.

The chip indeed allows One-pulse generation while triggering the slave with any of the possible slave triggers: ETR, internal triggers ITx, or input channels TI1FP1 or TI1FP2. But using HAL libraries generated by CubeMX will fail for any triggers except TI1FP1 and TI1FP2.

The HAL libraries for One-pulse generated by CubeMX written in such way that the function calls expect only two channels 1 and 2 used TI1FP1 and TI1FP2 as a trigger.

The team who wrote that code was so much convinced that this is the only allowed slave trigger for one-pulse that even STM App note dedicated to the One-pulse generation (I read it long ago and lost that link now) says that user "has to configure" TI1FP1 and TI1FP2 as a trigger following the steps. Text does not allow any other alternatives. All docs from STM32 insist on only these two triggers.

Once I replace HAL functions with my code directly controlling the MCU registers following only the MCU datasheet, my ETR trigger successfully triggered One-pulse .

View solution in original post

2 REPLIES 2

Read out and check/post content of TIM and relevant GPIO registers for one of the timers.

JW

eBirdman
Senior

I came back to provide the answer to my question for those who may have the same problem.

The chip indeed allows One-pulse generation while triggering the slave with any of the possible slave triggers: ETR, internal triggers ITx, or input channels TI1FP1 or TI1FP2. But using HAL libraries generated by CubeMX will fail for any triggers except TI1FP1 and TI1FP2.

The HAL libraries for One-pulse generated by CubeMX written in such way that the function calls expect only two channels 1 and 2 used TI1FP1 and TI1FP2 as a trigger.

The team who wrote that code was so much convinced that this is the only allowed slave trigger for one-pulse that even STM App note dedicated to the One-pulse generation (I read it long ago and lost that link now) says that user "has to configure" TI1FP1 and TI1FP2 as a trigger following the steps. Text does not allow any other alternatives. All docs from STM32 insist on only these two triggers.

Once I replace HAL functions with my code directly controlling the MCU registers following only the MCU datasheet, my ETR trigger successfully triggered One-pulse .