cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE/CubeMX Timer Configuration (Slave Mode / Gated Mode)

SS13
Associate II

I am trying to test Slave Mode / Gated Mode on TIM10 on my NUCLEO-STM32F401RE EVK.

RM0368 describes this mode as:

"Slave mode: Gated mode The counter can be enabled depending on the level of a selected input."

I am trying to use CubeIDE to generate the code, but I do not see this can be configured through the tool.

0693W00000JMFGsQAP.pngI don't see a way to configure any slave mode.

Is it true that CubeMX can't generate code for this configuration?

4 REPLIES 4

0693W00000JMFMvQAP.pngJW

SS13
Associate II

Note: The markup posted is for TIM2 to TIM5. I am attempting to use TIM10. However, the Reference Manual makes it look like the register referenced (TIMx_CCER) appears to have similar functionality.

JW:

I interpret the post to mean that I can use CCIP to achieve the configuration I need.

Is this correct?

... if so ...

I don't have much experience generating code with CubeMX/CubeIDE.

1) Am I correct in that the tool can't create code for the configuration I need? 

2) Should I be writing the code to call the appropriate HAL functions 'by hand'?

SS13
Associate II

I think I figured out why there was no way to select Slave Mode for TIM10. Although the Reference Manual groups TIM9 to TIM11 in the same section of General Purpose Timers, only TIM9 has TIMx_SMCR registers implemented.

0693W00000JMGcLQAX.png 

SS13
Associate II

Update: I was able to successfully use CubeIDE/CubeMX to generate code for TIM9.

0693W00000JMHDWQA5.png 

I had to disable UART2 on my NUCELO EVK to use PA2, I tested successfully with a pulse generator.