2013-03-25 04:30 AM
Hi,
I have a problem with transmitting character through USART3 port in STM32F207.Here there is the USART configuration code:--------------USART_DeInit(USART3);USART_InitStructure.USART_BaudRate = 115200;USART_InitStructure.USART_WordLength = USART_WordLength_8b;USART_InitStructure.USART_StopBits = USART_StopBits_1;USART_InitStructure.USART_Parity = USART_Parity_No;USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;USART_Init(USARTx, &USART_InitStructure);------------The problem occurs when sending characters, USART doesn't send the first one (checking with hyperterminal), and then it goes on with sending the others correctly. It just misses the first one. If I debug the code, this trouble doesn't occur and the transmission is correct. At the moment I'm sending a ''\r'' character at first, in order to send the correct string later, but this is not so reliable.Does anybody knows something about that?Thanks Stefano2013-03-26 09:52 AM
Testing the bit after is dumb as you wait the full time. Testing before is smart as you only wait once you're at the point of sending having dome something useful with the time since last loading the transmit register. This applies to many other situations also not just UART transmit registers.
2014-03-19 04:19 AM