AnsweredAssumed Answered

STM32F407 - USART6 Tx Frame Error

Question asked by yasar.yigit on Oct 18, 2017
Latest reply on Oct 19, 2017 by Tamas Novak

Hi All,

I tried to use USART6 but the data I sended is corrupted, I check the baudRate bur its looks fine(9600 bps), I add the screen shot of oscilloscope I send 0x79(0b0111 1001) but its showed me irrelevant data, also I tired the diffrent baudrate but result was same,
Here is my USART6 initialization code;

 

GPIO_InitTypeDef GPIO_InitStruct;
USART_InitTypeDef USART_InitStr;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);

GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);
GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);

GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_Init(GPIOC, &GPIO_InitStruct);

USART_InitStr.USART_BaudRate = 9600;
USART_InitStr.USART_WordLength = USART_WordLength_8b;
USART_InitStr.USART_StopBits = USART_StopBits_1;
USART_InitStr.USART_Parity = USART_Parity_No;
USART_InitStr.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStr.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART6, &USART_InitStr);

USART_Cmd(USART6, ENABLE);

 

I send with, USART_SendData(USART6, 0x79);

 

The response I read on terminal 0b1111 1001(Dec: 159)(Hx: F9)

 

Thanks in advanced.

Yigit

Attachments

Outcomes