cancel
Showing results for 
Search instead for 
Did you mean: 

Wanted TIM2_CH3 as Open Drain, got Push Pull

Emilio P.G. Ficara
Associate II

I want to use the pin 5 of STM8S001J3 micro as open drain output. After properly setting the port data / direction / CR1 / CR2 registers (for both the I/Os tied to such pin), I tried to activate the alternate function of TIM2_CH3 on PA.3 , but I couldn't be able to get the open drain configuration. The output results active on both high and low levels, like a push pull ouput. I added a diode (cathode towards the pin) to get my circuit working, but I've read on the datasheet (in the I/O ports description) that the alternate function will follow the settings of the port pin. So, if I set the port as O.D. output and then I set the alternate function of that port as TIM2_CH3 output, it still must be an Open Drain output. Is there something wrong ? Where is my mistake ? Does anybody experimented the same behaviour ? I don't want to use a timer interrupt and another pin (PB4 seems to be always O.D.) to obtain the same function. I can go on with the diode or with a transistor connected to that pin, but I'm just curious about the question. Thanks in advance for any answer or help.

2 REPLIES 2
Sigra
Associate

Hi Emilio, I ran into the same problem when I tried to use the PC7 of STM8S103F3P6 as TIM1_CH1. It could not be configured as an open-drain output. Have you solved it?

henry.dick
Senior II

Check your gpio configuration if everything fails put a diode on it.​