欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 51單片機的helloWorld實驗 Proteus仿真+代碼 [打印本頁]

作者: linuxcso    時間: 2019-3-13 09:32
標題: 51單片機的helloWorld實驗 Proteus仿真+代碼
基于proteus的Hello MCU 實驗
基本的串口配置及輸出實驗.
proteus 8.7以上打開,包括工程及源碼.


單片機源程序如下:
  1. #include<reg52.h>
  2. #include<stdio.h>
  3. #include <string.h>
  4. void delay_us(unsigned int x)
  5. {
  6.     while(x)
  7.     {
  8.         x=x-1;
  9.     }
  10. }
  11. //串口通信初始化 現在不需要理解配置原理,能用就行
  12. void uart(void)
  13. {
  14.     SCON=0x40;                                        //串口通信工作方式1
  15.     REN=1;                                                //允許接收
  16.     TMOD=0x20;                                        //定時器1的工作方式2
  17.     TH1=0xfd,TL1=0xfd;
  18.     TI=1;                       //這里一定要注意
  19.     TR1=1;                                                //打開定時器
  20. }
  21. void main(void)
  22. {
  23.     uart();
  24.     while(1)
  25.     {                          
  26.         printf("Hellp MCU!\r\n");
  27.         delay_us(65530);
  28.         printf("Hellp World!\r\n");
  29.         delay_us(65530);        
  30.     }
  31. }
復制代碼

所有資料51hei提供下載:
proteus_HelloMCU.zip (49.69 KB, 下載次數: 20)







歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1