在线时间0 小时
UID297994
ST金币0
蝴蝶豆0
注册时间2011-6-10
新手上路
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2011-6-13 10:26:48
|
显示全部楼层
a0a.1 0b0c
RE:STM32F103 的串口 数据不对
USART_InitTypeDef USART_InitStructure;
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_Tx; //设置为接受发送模式
USART_InitStructure.USART_Clock = USART_Clock_Disable; //禁止 USART 输出 Clock
USART_InitStructure.USART_CPOL = USART_CPOL_Low;
USART_InitStructure.USART_CPHA = USART_CPHA_2Edge;
USART_InitStructure.USART_LastBit = USART_LastBit_Disable;
USART_Init(USART1, &USART_InitStructure);
/*enable receive interrupt */
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
/* Enable USART1 */
USART_Cmd(USART1, ENABLE);
要不是库有问题 |
|