|
51單片機(jī)53L0x程序,實(shí)測(cè)可測(cè)2m
單片機(jī)源程序如下:
- #include "main.h"
- void main(void)
- {
- Usart_Config(); //串口配置
- Timer0_Config(); //定時(shí)器0配置
- system_start(); //系統(tǒng)上電自檢
-
- while(1)
- {
- system_service();//系統(tǒng)服務(wù)
- }
- }
- 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
- }
- }
復(fù)制代碼
所有資料51hei提供下載:
53L0x.rar
(76.26 KB, 下載次數(shù): 6)
2019-3-31 18:09 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
|