I am using the STM MCU timer for PWM. This PWM signals goes as input to external MOSFET configured as push pull. So I want the timer pin to be in high impedance state during some instance of time and rest of the time give the PWM output signal.
I tried the following functions to make the timer pin high impedance, but nothing works:-
__HAL_TIM_DISABLE(&htim3);
TIM_CCxChannelCmd(&htim3, TIM_CHANNEL_3, TIM_CCx_DISABLE);
__HAL_TIM_MOE_DISABLE(&htim3);
I also tried to configure the pin as input, but nothing works.
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = TIM3_CH3_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(TIM3_CH3_PORT, &GPIO_InitStruct);
Can some suggest how I can use the timer pin as PWM and at some other time, put the same pin in high impedance state?.