标题: stm32f103c6串口发送程序+Proteus仿真 [打印本页]

作者: zhangzehong    时间: 2020-7-1 09:32
标题: stm32f103c6串口发送程序+Proteus仿真
本人单片机萌新一枚,最近用protues仿真stm32f103c6进行串口数据,另外protues仿真还有一个bug,必须在前面加上RCC_SYSCLKConfig(RCC_SYSCLKSource_HSI);否则会一直发送0x00.
程序源码还有仿真文件在附件压缩包内。


单片机源程序如下:
  1. #include "stm32f10x.h"
  2. #include "stm32f10x_it.h"
  3. #include "led.h"
  4. #include "modbus.h"
  5. #include "delay.h"

  6. void SystemTick_Configuration( void );

  7. int main(void)
  8. {        
  9.                 RCC_SYSCLKConfig(RCC_SYSCLKSource_HSI);        //设置系统时钟HSI作为时钟源,用protues仿真串口发送接收时必须加上
  10.                 delay_init();
  11.                 LED_Init();
  12.                 RS485_Init();
  13.                 Timer1_Init();
  14.     while (1)
  15.     {
  16.                                 USART_SendData(USART2,0x55);
  17.                 }
  18. }
复制代码

的收发,各位大佬有需要可以学习一下。
全部资料51hei下载地址:
仿真 - 串口发送.7z (265.46 KB, 下载次数: 110)

作者: 1486000676    时间: 2020-7-22 15:53
亲,这个proteus的原理图没有吗?




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1