AnsweredAssumed Answered

stm32f10tvct uart5

Question asked by aymen.bellili on Mar 8, 2013
Latest reply on Mar 13, 2013 by Clive One
hi,
I'm working with the stm3210c_eval and I would like to use the UART5 .
this is the configuration

void UART5_Init(void)
{
  GPIO_InitTypeDef GPIO_InitStructure;
  USART_InitTypeDef USART_InitStructure;

  /* Clock configuration -------------------------------------------------------*/

  /* Configure the GPIO ports( UART5 Transmit and Receive Lines) */
  /* Configure the UART5_Tx as Alternate function Push-Pull */
  /* Configure UART5_Tx as alternate function push-pull */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  GPIO_Init(GPIOC, &GPIO_InitStructure);

  /* Configure UART5_Rx as input floating */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  GPIO_Init(GPIOD, &GPIO_InitStructure);  


  /* UART5 configuration ------------------------------------------------------*/
  /* UART5 configured as follow:
        - BaudRate = 9600 baud  
        - Word Length = 8 Bits
        - One Stop Bit
        - No parity
        - Hardware flow control disabled (RTS and CTS signals)
        - Receive and transmit enabled
  */
  USART_InitStructure.USART_BaudRate = 9600;
  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;

  /* Configure the UART5 */
  USART_Init(UART5, &USART_InitStructure);

        /* Enable UART5 interrupt */
        USART_ITConfig(UART5, USART_IT_RXNE, ENABLE);

  /* Enable the UART5 */
  USART_Cmd(UART5, ENABLE);
}

I can send and recieve data.
my problem is that I recieve a wrong data and the same when I send.

Outcomes