打印

编译了 UART 例子

[复制链接]
2591|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的初始化看了,应该和我修改了主频没有关系吧?
 

使用特权

评论回复
5
hotpower| | 2008-2-6 04:35 | 只看该作者

不会吧~~~

哈哈~~~最近折腾dsp...看来要抽空玩STM32了~~~十分郁闷~~~

使用特权

评论回复
6
ICdandan| | 2008-2-27 13:02 | 只看该作者

恭喜

使用特权

评论回复
7
nomoneyiv| | 2008-3-6 09:53 | 只看该作者

继续

你其他的代码都没说明,仅凭这点无法判断,
我调试USART正常呀!

使用特权

评论回复
8
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

粉丝