Skip to main content
SS13
Associate III
January 17, 2022
Question

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

  • January 17, 2022
  • 4 replies
  • 3245 views

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?

This topic has been closed for replies.

4 replies

waclawek.jan
Super User
January 17, 2022

0693W00000JMFMvQAP.pngJW

SS13
SS13Author
Associate III
January 17, 2022

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
SS13Author
Associate III
January 17, 2022

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
SS13Author
Associate III
January 17, 2022

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.