编译了 UART 例子

[复制链接]
3392|7
 楼主| americ 发表于 2008-1-26 17:07 | 显示全部楼层 |阅读模式
bin   97,012 字节


经过了很多步骤,终于成功编译,生成bin文件
97,012 字节



USART
Example2 Use the USART1 interrupts to communicate with the hyperterminal. 

firmware libraries for STM32


哈哈



phoenixmy 发表于 2008-1-26 17:16 | 显示全部楼层

恭喜楼上



成功第一步
 楼主| americ 发表于 2008-1-26 17:22 | 显示全部楼层

文件大小??

有点晕

speed_2008 发表于 2008-2-1 11:41 | 显示全部楼层

请教楼主


USART通讯问题请教楼主:
我也是用Example2中断方式和PC通讯的,检查UASRT1的各项配置好像都是正常的,但是我用SSVCOM32接收的数据是乱码,用超级终端只能收到个别字符,无法识别,感觉是波特率不对,是不是还有什么参数需要修改啊
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_Even;
  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
  USART_InitStructure.USART_Clock = USART_Clock_Disable;
  USART_InitStructure.USART_CPOL = USART_CPOL_Low;
  USART_InitStructure.USART_CPHA = USART_CPHA_2Edge;
  USART_InitStructure.USART_LastBit = USART_LastBit_Disable;
  /* Configure the USART1 */
  USART_Init(USART1, &USART_InitStructure);
/* Enable the USART Transmoit interrupt: this interrupt is generated when the 
   USART1 transmit data register is empty */  
  USART_ITConfig(USART1, USART_IT_TXE, ENABLE);
/* Enable the USART Receive interrupt: this interrupt is generated when the 
   USART1 receive data register is not empty */
  USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
  /* Enable USART1 */
  USART_Cmd(USART1, ENABLE);
USART的波特率和主频是无关的,我跟踪进USART的初始化看了,应该和我修改了主频没有关系吧?
 
hotpower 发表于 2008-2-6 04:35 | 显示全部楼层

不会吧~~~

哈哈~~~最近折腾dsp...看来要抽空玩STM32了~~~十分郁闷~~~
ICdandan 发表于 2008-2-27 13:02 | 显示全部楼层
nomoneyiv 发表于 2008-3-6 09:53 | 显示全部楼层

继续

你其他的代码都没说明,仅凭这点无法判断,
我调试USART正常呀!
nomoneyiv 发表于 2008-3-6 11:02 | 显示全部楼层

GPIO 设置的如何?

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
    
  /* Configure USART1 Rx (PA.10) as input floating */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
您需要登录后才可以回帖 登录 | 注册

本版积分规则

48

主题

288

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部