Skip to main content
Explorer
September 22, 2024
Question

A question on pin labeling for STM32H7

  • September 22, 2024
  • 2 replies
  • 701 views

The STM32H7 reference manual (stm32h723zg.pdf) contains several tables describing he pin mappings (pin to functions).

In Table 7 and 8, for pin A0, A5, and A15, it lists the pin function as "TIM2_CH1/TIM2_ETR" for alternate function #0.

 

Should this be interpreted to mean that, when this alternate function is selected for the pin, it both the function of CH1 and ETR for timer 2 (i.e., it is connected to both the CH1 and ETR of the TIM2 peripheral)? Or is there a way to select whether CH1 or ETR is active?

I could not find this in the documentation.

    This topic has been closed for replies.

    2 replies

    Super User
    September 22, 2024

    Activating CH1 or ETR is done in the timer register settings, not at the GPIO AF level. CH1 is controlled with OC1M and other fields within TIMx_CCMR1 and ETR is controlled by ETRSEL, at least as far as connecting it to the pin.

    STM32H723/733, STM32H725/735 and STM32H730 Value line advanced Arm®-based 32-bit MCUs - Reference manual

     

    I don't see anything which says you can't activate CH1 and ETR at the same time, although CubeMX won't let you do this and it's a bit weird.

    sidneyAuthor
    Explorer
    September 23, 2024

    I also don't see harm in this, given that ETR is strictly an input, so even when both CH1 and ETR are activated there is no potential harm in tying them together.

    But this only happens for TIM2, and it isn't specifically explained in the documentation; which is why I bring it up. Perhaps there was some TIM2-specific setting or footnote in the documentation that I missed somehow.