AnsweredAssumed Answered

STM32F100C6 USART TX pin floating after stopbit

Question asked by Kim Tommy on Mar 25, 2015
Latest reply on Mar 27, 2015 by Clive One

Using USART, configured as a normal uart full duplex, we see that the TX pin from the MCU is floating after the stopbit. This seems to be causing issues in some cases.

Question 1:
What is the default behavior of the TX pin, should it be floating or held high when idle from the MCU or is it correct to add an external pull up?

Question 2:
Depending on answer on Q1, is there any register setup that could cause the floating TX we're seeing? 

Additional info:
* In reference manual Smartcard communication setup uses a mode where the TX line can be driven by the receiver right after the stop bit. But then the port is configured as Open-drain. We configure it as Push-Pull

* Our code is mainly written without use of the standard libraries functions.

* Some modified code snippets, this is only to show the register settings:
// Setting PortA Pin2 to Alternate function Push Pull output (remap not shown)
// CNF_ALT_PUSH_PULL_OUTPUT = 0x00000008,  
// MODE_OUTPUT_2MHZ = 0x00000002 

// Setting CR1 - ParityBits = 0x0000, No parity (M=0, PCE=0, PS=0)
USART2->CR1 = (USART_CR1_RXNEIE | USART_CR1_RE | ParityBits); 

// Setting CR2
USART2->CR2 = 0; // STOPBIT = 0, LINEN=0, CLKEN=0, CPOL=0, CPHA=0, LBCL=0, LBDIE=0, LBDL=0, ADD=0

// CR3 left untouched.. CTSIE=0, CTSE=0, RTSE=0, DMAT=0, DMAR=0, SCEN=0, NACK=0, HDSEL=0, IRLP=0, IREN=0, EIE=0

I'll add real code if needed depending on the questions asked.
Thanks in advance for any comments and help.

/Kim Tommy