AnsweredAssumed Answered

STM32F107 Uart 5 always sets MSB when sending

Question asked by Goebel.Vincent on Mar 11, 2014
Latest reply on Mar 12, 2014 by Goebel.Vincent
Hi everyone,
the title says it all. Scope tells me the timing is fine and the signal looks like it should. Receiving on the other end works. Except the MSB always being set to 1, no matter if I try to send values higher or lower than 127. The debugger confirms that all the settings are fine (USART_CR1 - CR3).  USART_DR is getting the correct value ( In my case 0x10 ). USART_SR shows no errors either. Any advice would be appreciated.

The init looks like this: 

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOD, &GPIO_InitStructure);

//UART5 -> 2400B, 8-E-1
USART_InitStructure.USART_BaudRate = 2400;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_Parity = USART_Parity_Even;  //USART_Parity_Even;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(UART5, &USART_InitStructure); //Init