51单片机53L0x程序,实测可测2m
单片机源程序如下:
- #include "main.h"
- void main(void)
- {
- Usart_Config(); //串口配置
- Timer0_Config(); //定时器0配置
- system_start(); //系统上电自检
-
- while(1)
- {
- system_service();//系统服务
- }
- }
- void Timer0_isr() interrupt 1 using 1
- {
- timer0cnt++;
- if(checkcnt<5000) checkcnt++;
- if(systemtick!=0) systemtick++;
- if(keycnt !=0) keycnt ++;
-
- TH0 = (65536-1000)/256;
- TL0 = (65536-1000)%256;
-
- }
- void Usart_Isr() interrupt 4 using 1
- {
- if (RI)
- {
- RI = 0; //Clear receive interrupt flag
- }
- if (TI)
- {
- TI = 0; //Clear transmit interrupt flag
- busy = 0; //Clear transmit busy flag
- }
- }
复制代码
所有资料51hei提供下载:
53L0x.rar
(76.26 KB, 下载次数: 6)
|