AnsweredAssumed Answered

CubeMX and One Pulse Mode

Question asked by Zhitai Liu on Sep 28, 2017

In STM32CubeF4 STM32F446ZE, there is a timer one pulse mode example.

Setting TIM3 CH2 as input capture and CH1 as Output Compare to work as One pulse mode.

(Set slave mode as trigger mode and trigger source as TI2FP2 )

It works  totally fine!

 

However, It seems that CubeMX cannot be configured to do this job!

(Let's suppose CubeMX is used. I hope this is not a stupid question because I am told to offer an ioc project)

 

Let's review what needs to be done for TIM3 as One Pule Mode using CH2 as Input capture and CH1 as Output compare.

1. TIM3 CH2 as input capture

2. TIM3 CH1 as Output Compare, PWM mode 2

3. Slave mode as trigger mode.

4. trigger source as TI2FP2.

5. one pulse mode is enabled.

 

A typical one pulse mode (OPM) looks like this, Yellow wave is CH2 input capture, Blue wave is the Output compare pulse toggling high with a certain period after a certain delay.

 

Now back to our CubeMX,

Trigger source must be chosen first....

Once TIFP2 is chosen, channel2 becomes not configurable!

See below:

Have I misunderstood something?

Isn't it wired? Because we cannot even configure CH2 as input capture!!??

i.e. in register TIM3 CCMR1, CC2S cannot be set to 0x01, means CC2 as  input  and IC2 maps to TI2

Using this setting to generate the code would fail to set CC2S bits correctly, only remain 0x00. (as output)

(This would dramatically reduce the input impedance of this input channel)

 

So, my question is:

Can CubeMX be configured to work in this scenario? Or it just DON'T support!

 

Thanks for reading my post!

 

 

.Zt

Outcomes