2024-09-22 01:34 AM
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.
2024-09-22 08:54 AM
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.
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.
2024-09-22 10:50 PM
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.