第三次优化代码,增加支持keil4的注释,此外优化LCD1602显示
This commit is contained in:
@@ -0,0 +1,198 @@
|
|||||||
|
$NOMOD51
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; This file is part of the C51 Compiler package
|
||||||
|
; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
|
||||||
|
; Version 8.01
|
||||||
|
;
|
||||||
|
; *** <<< Use Configuration Wizard in Context Menu >>> ***
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; STARTUP.A51: This code is executed after processor reset.
|
||||||
|
;
|
||||||
|
; To translate this file use A51 with the following invocation:
|
||||||
|
;
|
||||||
|
; A51 STARTUP.A51
|
||||||
|
;
|
||||||
|
; To link the modified STARTUP.OBJ file to your application use the following
|
||||||
|
; Lx51 invocation:
|
||||||
|
;
|
||||||
|
; Lx51 your object file list, STARTUP.OBJ controls
|
||||||
|
;
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; User-defined <h> Power-On Initialization of Memory
|
||||||
|
;
|
||||||
|
; With the following EQU statements the initialization of memory
|
||||||
|
; at processor reset can be defined:
|
||||||
|
;
|
||||||
|
; <o> IDATALEN: IDATA memory size <0x0-0x100>
|
||||||
|
; <i> Note: The absolute start-address of IDATA memory is always 0
|
||||||
|
; <i> The IDATA space overlaps physically the DATA and BIT areas.
|
||||||
|
IDATALEN EQU 80H
|
||||||
|
;
|
||||||
|
; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
|
||||||
|
; <i> The absolute start address of XDATA memory
|
||||||
|
XDATASTART EQU 0
|
||||||
|
;
|
||||||
|
; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
|
||||||
|
; <i> The length of XDATA memory in bytes.
|
||||||
|
XDATALEN EQU 0
|
||||||
|
;
|
||||||
|
; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
|
||||||
|
; <i> The absolute start address of PDATA memory
|
||||||
|
PDATASTART EQU 0H
|
||||||
|
;
|
||||||
|
; <o> PDATALEN: PDATA memory size <0x0-0xFF>
|
||||||
|
; <i> The length of PDATA memory in bytes.
|
||||||
|
PDATALEN EQU 0H
|
||||||
|
;
|
||||||
|
;</h>
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
;
|
||||||
|
;<h> Reentrant Stack Initialization
|
||||||
|
;
|
||||||
|
; The following EQU statements define the stack pointer for reentrant
|
||||||
|
; functions and initialized it:
|
||||||
|
;
|
||||||
|
; <h> Stack Space for reentrant functions in the SMALL model.
|
||||||
|
; <q> IBPSTACK: Enable SMALL model reentrant stack
|
||||||
|
; <i> Stack space for reentrant functions in the SMALL model.
|
||||||
|
IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
|
||||||
|
; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
|
||||||
|
; <i> Set the top of the stack to the highest location.
|
||||||
|
IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
|
||||||
|
; </h>
|
||||||
|
;
|
||||||
|
; <h> Stack Space for reentrant functions in the LARGE model.
|
||||||
|
; <q> XBPSTACK: Enable LARGE model reentrant stack
|
||||||
|
; <i> Stack space for reentrant functions in the LARGE model.
|
||||||
|
XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
|
||||||
|
; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
|
||||||
|
; <i> Set the top of the stack to the highest location.
|
||||||
|
XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
|
||||||
|
; </h>
|
||||||
|
;
|
||||||
|
; <h> Stack Space for reentrant functions in the COMPACT model.
|
||||||
|
; <q> PBPSTACK: Enable COMPACT model reentrant stack
|
||||||
|
; <i> Stack space for reentrant functions in the COMPACT model.
|
||||||
|
PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
|
||||||
|
;
|
||||||
|
; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
|
||||||
|
; <i> Set the top of the stack to the highest location.
|
||||||
|
PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
|
||||||
|
; </h>
|
||||||
|
;</h>
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; Memory Page for Using the Compact Model with 64 KByte xdata RAM
|
||||||
|
; <e>Compact Model Page Definition
|
||||||
|
;
|
||||||
|
; <i>Define the XDATA page used for PDATA variables.
|
||||||
|
; <i>PPAGE must conform with the PPAGE set in the linker invocation.
|
||||||
|
;
|
||||||
|
; Enable pdata memory page initalization
|
||||||
|
PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
|
||||||
|
;
|
||||||
|
; <o> PPAGE number <0x0-0xFF>
|
||||||
|
; <i> uppermost 256-byte address of the page used for PDATA variables.
|
||||||
|
PPAGE EQU 0
|
||||||
|
;
|
||||||
|
; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
|
||||||
|
; <i> most 8051 variants use P2 as uppermost address byte
|
||||||
|
PPAGE_SFR DATA 0A0H
|
||||||
|
;
|
||||||
|
; </e>
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; Standard SFR Symbols
|
||||||
|
ACC DATA 0E0H
|
||||||
|
B DATA 0F0H
|
||||||
|
SP DATA 81H
|
||||||
|
DPL DATA 82H
|
||||||
|
DPH DATA 83H
|
||||||
|
|
||||||
|
NAME ?C_STARTUP
|
||||||
|
|
||||||
|
|
||||||
|
?C_C51STARTUP SEGMENT CODE
|
||||||
|
?STACK SEGMENT IDATA
|
||||||
|
|
||||||
|
RSEG ?STACK
|
||||||
|
DS 1
|
||||||
|
|
||||||
|
EXTRN CODE (?C_START)
|
||||||
|
PUBLIC ?C_STARTUP
|
||||||
|
|
||||||
|
CSEG AT 0
|
||||||
|
?C_STARTUP: LJMP STARTUP1
|
||||||
|
|
||||||
|
RSEG ?C_C51STARTUP
|
||||||
|
|
||||||
|
STARTUP1:
|
||||||
|
|
||||||
|
IF IDATALEN <> 0
|
||||||
|
MOV R0,#IDATALEN - 1
|
||||||
|
CLR A
|
||||||
|
IDATALOOP: MOV @R0,A
|
||||||
|
DJNZ R0,IDATALOOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF XDATALEN <> 0
|
||||||
|
MOV DPTR,#XDATASTART
|
||||||
|
MOV R7,#LOW (XDATALEN)
|
||||||
|
IF (LOW (XDATALEN)) <> 0
|
||||||
|
MOV R6,#(HIGH (XDATALEN)) +1
|
||||||
|
ELSE
|
||||||
|
MOV R6,#HIGH (XDATALEN)
|
||||||
|
ENDIF
|
||||||
|
CLR A
|
||||||
|
XDATALOOP: MOVX @DPTR,A
|
||||||
|
INC DPTR
|
||||||
|
DJNZ R7,XDATALOOP
|
||||||
|
DJNZ R6,XDATALOOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF PPAGEENABLE <> 0
|
||||||
|
MOV PPAGE_SFR,#PPAGE
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF PDATALEN <> 0
|
||||||
|
MOV R0,#LOW (PDATASTART)
|
||||||
|
MOV R7,#LOW (PDATALEN)
|
||||||
|
CLR A
|
||||||
|
PDATALOOP: MOVX @R0,A
|
||||||
|
INC R0
|
||||||
|
DJNZ R7,PDATALOOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF IBPSTACK <> 0
|
||||||
|
EXTRN DATA (?C_IBP)
|
||||||
|
|
||||||
|
MOV ?C_IBP,#LOW IBPSTACKTOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF XBPSTACK <> 0
|
||||||
|
EXTRN DATA (?C_XBP)
|
||||||
|
|
||||||
|
MOV ?C_XBP,#HIGH XBPSTACKTOP
|
||||||
|
MOV ?C_XBP+1,#LOW XBPSTACKTOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF PBPSTACK <> 0
|
||||||
|
EXTRN DATA (?C_PBP)
|
||||||
|
MOV ?C_PBP,#LOW PBPSTACKTOP
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
MOV SP,#?STACK-1
|
||||||
|
|
||||||
|
; This code is required if you use L51_BANK.A51 with Banking Mode 4
|
||||||
|
;<h> Code Banking
|
||||||
|
; <q> Select Bank 0 for L51_BANK.A51 Mode 4
|
||||||
|
#if 0
|
||||||
|
; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
|
||||||
|
EXTRN CODE (?B_SWITCH0)
|
||||||
|
CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
|
||||||
|
#endif
|
||||||
|
;</h>
|
||||||
|
LJMP ?C_START
|
||||||
|
|
||||||
|
END
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
#include"ds1302.h"
|
||||||
|
|
||||||
|
/* DS1302读写地址 */
|
||||||
|
/* 存储顺序为秒分时日月周年 */
|
||||||
|
uchar code READ_RTC_ADDR[7] = {0x81, 0x83, 0x85, 0x87, 0x89, 0x8b, 0x8d};
|
||||||
|
uchar code WRITE_RTC_ADDR[7] = {0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c};
|
||||||
|
|
||||||
|
/* DS1302默认时间:2013年1月1日周二 12:00:00 */
|
||||||
|
/* 存储顺序:秒 分 时 日 月 星期 年 */
|
||||||
|
/* 存储格式:BCD码 */
|
||||||
|
uchar TIME[7] = {0, 0, 0x12, 0x01, 0x01, 0x02, 0x13};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:Ds1302Write
|
||||||
|
* 功能 :向DS1302写入数据(地址+数据)
|
||||||
|
* 输入 :addr=寄存器地址, dat=要写入的数据
|
||||||
|
* 输出 :无
|
||||||
|
*/
|
||||||
|
void Ds1302Write(uchar addr, uchar dat)
|
||||||
|
{
|
||||||
|
uchar n;
|
||||||
|
RST = 0;
|
||||||
|
_nop_();
|
||||||
|
|
||||||
|
SCLK = 0; /* 先将时钟线置低 */
|
||||||
|
_nop_();
|
||||||
|
RST = 1; /* 然后RST(CE)置高,开始通信 */
|
||||||
|
_nop_();
|
||||||
|
|
||||||
|
for (n=0; n<8; n++) /* 发送8位地址命令 */
|
||||||
|
{
|
||||||
|
DSIO = addr & 0x01; /* 数据从低位开始 */
|
||||||
|
addr >>= 1;
|
||||||
|
SCLK = 1; /* 上升沿时DS1302读取数据 */
|
||||||
|
_nop_();
|
||||||
|
SCLK = 0;
|
||||||
|
_nop_();
|
||||||
|
}
|
||||||
|
for (n=0; n<8; n++) /* 写入8位数据 */
|
||||||
|
{
|
||||||
|
DSIO = dat & 0x01;
|
||||||
|
dat >>= 1;
|
||||||
|
SCLK = 1; /* 上升沿时DS1302读取数据 */
|
||||||
|
_nop_();
|
||||||
|
SCLK = 0;
|
||||||
|
_nop_();
|
||||||
|
}
|
||||||
|
|
||||||
|
RST = 0; /* 结束数据传输 */
|
||||||
|
_nop_();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:Ds1302Read
|
||||||
|
* 功能 :从DS1302读取一个字节数据
|
||||||
|
* 输入 :addr=寄存器地址
|
||||||
|
* 输出 :读取到的数据
|
||||||
|
*/
|
||||||
|
uchar Ds1302Read(uchar addr)
|
||||||
|
{
|
||||||
|
uchar n,dat,dat1;
|
||||||
|
RST = 0;
|
||||||
|
_nop_();
|
||||||
|
|
||||||
|
SCLK = 0; /* 先将时钟线置低 */
|
||||||
|
_nop_();
|
||||||
|
RST = 1; /* 然后RST(CE)置高,开始通信 */
|
||||||
|
_nop_();
|
||||||
|
|
||||||
|
for(n=0; n<8; n++) /* 发送8位地址命令 */
|
||||||
|
{
|
||||||
|
DSIO = addr & 0x01; /* 数据从低位开始 */
|
||||||
|
addr >>= 1;
|
||||||
|
SCLK = 1; /* 上升沿时DS1302读取数据 */
|
||||||
|
_nop_();
|
||||||
|
SCLK = 0; /* 下降沿时DS1302输出数据 */
|
||||||
|
_nop_();
|
||||||
|
}
|
||||||
|
_nop_();
|
||||||
|
for(n=0; n<8; n++) /* 读取8位数据 */
|
||||||
|
{
|
||||||
|
dat1 = DSIO; /* 从高位开始 */
|
||||||
|
dat = (dat>>1) | (dat1<<7);
|
||||||
|
SCLK = 1;
|
||||||
|
_nop_();
|
||||||
|
SCLK = 0; /* 下降沿时DS1302输出数据 */
|
||||||
|
_nop_();
|
||||||
|
}
|
||||||
|
|
||||||
|
RST = 0;
|
||||||
|
_nop_(); /* 以下为DS1302复位时序,确保稳定 */
|
||||||
|
SCLK = 1;
|
||||||
|
_nop_();
|
||||||
|
DSIO = 0;
|
||||||
|
_nop_();
|
||||||
|
DSIO = 1;
|
||||||
|
_nop_();
|
||||||
|
return dat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:Ds1302Init
|
||||||
|
* 功能 :初始化DS1302时钟芯片
|
||||||
|
* 输入 :无
|
||||||
|
* 输出 :无
|
||||||
|
* 说明 :判断CH位,若时钟已运行则跳过初始化
|
||||||
|
*/
|
||||||
|
void Ds1302Init()
|
||||||
|
{
|
||||||
|
uchar n;
|
||||||
|
uchar sec;
|
||||||
|
sec = Ds1302Read(0x81); /* 读取秒寄存器,检查CH位 */
|
||||||
|
if(!(sec & 0x80)) /* CH=0表示时钟已运行,无需初始化 */
|
||||||
|
return; /* 首次上电,写入默认时间 */
|
||||||
|
Ds1302Write(0x8E,0X00); /* 关闭写保护 */
|
||||||
|
for (n=0; n<7; n++)
|
||||||
|
{
|
||||||
|
Ds1302Write(WRITE_RTC_ADDR[n],TIME[n]);
|
||||||
|
}
|
||||||
|
Ds1302Write(0x8E,0x80); /* 开启写保护 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:Ds1302ReadTime
|
||||||
|
* 功能 :读取DS1302当前时间到TIME数组
|
||||||
|
* 输入 :无
|
||||||
|
* 输出 :无
|
||||||
|
*/
|
||||||
|
void Ds1302ReadTime()
|
||||||
|
{
|
||||||
|
uchar n;
|
||||||
|
for (n=0; n<7; n++) /* 读取7个字节的时间数据 */
|
||||||
|
{
|
||||||
|
TIME[n] = Ds1302Read(READ_RTC_ADDR[n]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef __DS1302_H_
|
||||||
|
#define __DS1302_H_
|
||||||
|
|
||||||
|
/* 包含头文件 */
|
||||||
|
#include<reg51.h>
|
||||||
|
#include<intrins.h>
|
||||||
|
|
||||||
|
/* 数据类型重定义 */
|
||||||
|
#ifndef uchar
|
||||||
|
#define uchar unsigned char
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef uint
|
||||||
|
#define uint unsigned int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DS1302使用的IO口定义 */
|
||||||
|
sbit DSIO=P1^1; /* 数据线 */
|
||||||
|
sbit RST=P1^2; /* 复位/使能线 */
|
||||||
|
sbit SCLK=P1^0; /* 时钟线 */
|
||||||
|
|
||||||
|
/* 外部函数声明 */
|
||||||
|
void Ds1302Write(uchar addr, uchar dat); /* 写DS1302 */
|
||||||
|
uchar Ds1302Read(uchar addr); /* 读DS1302 */
|
||||||
|
void Ds1302Init(); /* 初始化DS1302 */
|
||||||
|
void Ds1302ReadTime(); /* 读取DS1302时间 */
|
||||||
|
|
||||||
|
/* 外部全局变量声明 */
|
||||||
|
extern uchar TIME[7]; /* 时间数组 */
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
#include "ds18b20.h"
|
||||||
|
|
||||||
|
/* DS18B20复位 */
|
||||||
|
void DS18B20_Reset(void)
|
||||||
|
{
|
||||||
|
uchar i;
|
||||||
|
DS18B20_DQ = 0; /* 拉低总线 */
|
||||||
|
for(i=0; i<200; i++); /* 延时约480us */
|
||||||
|
DS18B20_DQ = 1; /* 释放总线 */
|
||||||
|
for(i=0; i<100; i++); /* 等待存在脉冲 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DS18B20写入一个字节 */
|
||||||
|
void DS18B20_WriteByte(uchar dat)
|
||||||
|
{
|
||||||
|
uchar i, j;
|
||||||
|
for(i=0; i<8; i++)
|
||||||
|
{
|
||||||
|
DS18B20_DQ = 0; /* 拉低总线开始写时隙 */
|
||||||
|
_nop_();
|
||||||
|
if(dat & 0x01) /* 写1 */
|
||||||
|
DS18B20_DQ = 1;
|
||||||
|
else /* 写0 */
|
||||||
|
DS18B20_DQ = 0;
|
||||||
|
for(j=0; j<30; j++); /* 保持时间约60us */
|
||||||
|
DS18B20_DQ = 1; /* 释放总线 */
|
||||||
|
_nop_();
|
||||||
|
_nop_();
|
||||||
|
dat >>= 1; /* 下一位 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DS18B20读取一个字节 */
|
||||||
|
uchar DS18B20_ReadByte(void)
|
||||||
|
{
|
||||||
|
uchar i, j, dat = 0;
|
||||||
|
for(i=0; i<8; i++)
|
||||||
|
{
|
||||||
|
dat >>= 1;
|
||||||
|
DS18B20_DQ = 0; /* 拉低总线开始读时隙 */
|
||||||
|
_nop_();
|
||||||
|
DS18B20_DQ = 1; /* 释放总线 */
|
||||||
|
_nop_();
|
||||||
|
_nop_();
|
||||||
|
if(DS18B20_DQ) /* 读取数据 */
|
||||||
|
dat |= 0x80;
|
||||||
|
for(j=0; j<20; j++); /* 保持时间 */
|
||||||
|
}
|
||||||
|
return dat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 启动温度转换 */
|
||||||
|
void DS18B20_StartConvert(void)
|
||||||
|
{
|
||||||
|
DS18B20_Reset(); /* 复位 */
|
||||||
|
DS18B20_WriteByte(0xCC); /* 跳过ROM */
|
||||||
|
DS18B20_WriteByte(0x44); /* 启动温度转换 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置DS18B20分辨率 */
|
||||||
|
/* res: 0x1F=9bit, 0x3F=10bit, 0x5F=11bit, 0x7F=12bit */
|
||||||
|
void DS18B20_SetResolution(uchar res)
|
||||||
|
{
|
||||||
|
DS18B20_Reset();
|
||||||
|
DS18B20_WriteByte(0xCC); /* 跳过ROM */
|
||||||
|
DS18B20_WriteByte(0x4E); /* 写暂存器 */
|
||||||
|
DS18B20_WriteByte(0x00); /* TH告警值 */
|
||||||
|
DS18B20_WriteByte(0x00); /* TL告警值 */
|
||||||
|
DS18B20_WriteByte(res); /* 配置寄存器 */
|
||||||
|
DS18B20_Reset();
|
||||||
|
DS18B20_WriteByte(0xCC); /* 跳过ROM */
|
||||||
|
DS18B20_WriteByte(0x48); /* 复制暂存器到EEPROM */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 读取温度值 */
|
||||||
|
/* 返回1表示成功,temp存放原始温度值 */
|
||||||
|
bit DS18B20_GetTemp(int *temp)
|
||||||
|
{
|
||||||
|
uchar tempL, tempH;
|
||||||
|
int raw;
|
||||||
|
|
||||||
|
DS18B20_Reset();
|
||||||
|
DS18B20_WriteByte(0xCC); /* 跳过ROM */
|
||||||
|
DS18B20_WriteByte(0xBE); /* 读取暂存器 */
|
||||||
|
|
||||||
|
tempL = DS18B20_ReadByte(); /* 读取温度低字节 */
|
||||||
|
tempH = DS18B20_ReadByte(); /* 读取温度高字节 */
|
||||||
|
|
||||||
|
raw = (tempH << 8) | tempL; /* 合成16位温度值 */
|
||||||
|
*temp = raw;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef __DS18B20_H_
|
||||||
|
#define __DS18B20_H_
|
||||||
|
|
||||||
|
#include<reg51.h>
|
||||||
|
#include<intrins.h>
|
||||||
|
|
||||||
|
/* 数据类型重定义 */
|
||||||
|
#ifndef uchar
|
||||||
|
#define uchar unsigned char
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef uint
|
||||||
|
#define uint unsigned int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DS18B20数据线引脚定义 */
|
||||||
|
sbit DS18B20_DQ = P3^7;
|
||||||
|
|
||||||
|
/* 函数声明 */
|
||||||
|
void DS18B20_Reset(void); /* 复位DS18B20 */
|
||||||
|
void DS18B20_WriteByte(uchar dat); /* 写入一个字节 */
|
||||||
|
uchar DS18B20_ReadByte(void); /* 读取一个字节 */
|
||||||
|
void DS18B20_StartConvert(void); /* 启动温度转换 */
|
||||||
|
bit DS18B20_GetTemp(int *temp); /* 读取温度值 */
|
||||||
|
void DS18B20_SetResolution(uchar res); /* 设置分辨率 */
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
#include"lcd.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:Lcd1602_Delay1ms
|
||||||
|
* 功能 :延时1ms
|
||||||
|
* 输入 :c=延时ms数
|
||||||
|
* 输出 :无
|
||||||
|
* 说明 :12MHz晶振,12分频下的延时函数
|
||||||
|
*/
|
||||||
|
void Lcd1602_Delay1ms(uint c)
|
||||||
|
{
|
||||||
|
uchar a,b;
|
||||||
|
for (; c>0; c--)
|
||||||
|
{
|
||||||
|
for (b=199;b>0;b--)
|
||||||
|
{
|
||||||
|
for(a=1;a>0;a--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:LcdWriteCom
|
||||||
|
* 功能 :向LCD写入8位命令
|
||||||
|
* 输入 :com=命令字节
|
||||||
|
* 输出 :无
|
||||||
|
*/
|
||||||
|
#ifndef LCD1602_4PINS /* 8位数据线模式 */
|
||||||
|
void LcdWriteCom(uchar com)
|
||||||
|
{
|
||||||
|
LCD1602_E = 0; /* 使能信号置低 */
|
||||||
|
LCD1602_RS = 0; /* 选择指令寄存器 */
|
||||||
|
LCD1602_RW = 0; /* 选择写操作 */
|
||||||
|
|
||||||
|
LCD1602_DATAPINS = com; /* 写入命令 */
|
||||||
|
Lcd1602_Delay1ms(1); /* 等待数据稳定 */
|
||||||
|
|
||||||
|
LCD1602_E = 1; /* 写入时序 */
|
||||||
|
Lcd1602_Delay1ms(5); /* 保持时间 */
|
||||||
|
LCD1602_E = 0;
|
||||||
|
}
|
||||||
|
#else /* 4位数据线模式 */
|
||||||
|
void LcdWriteCom(uchar com)
|
||||||
|
{
|
||||||
|
LCD1602_E = 0;
|
||||||
|
LCD1602_RS = 0;
|
||||||
|
LCD1602_RW = 0;
|
||||||
|
|
||||||
|
LCD1602_DATAPINS = com; /* 写入高4位 */
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
|
||||||
|
LCD1602_E = 1;
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_E = 0;
|
||||||
|
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_DATAPINS = com << 4; /* 写入低4位 */
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
|
||||||
|
LCD1602_E = 1;
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_E = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:LcdWriteData
|
||||||
|
* 功能 :向LCD写入8位数据
|
||||||
|
* 输入 :dat=数据字节
|
||||||
|
* 输出 :无
|
||||||
|
*/
|
||||||
|
#ifndef LCD1602_4PINS /* 8位数据线模式 */
|
||||||
|
void LcdWriteData(uchar dat)
|
||||||
|
{
|
||||||
|
LCD1602_E = 0; /* 使能信号置低 */
|
||||||
|
LCD1602_RS = 1; /* 选择数据寄存器 */
|
||||||
|
LCD1602_RW = 0; /* 选择写操作 */
|
||||||
|
|
||||||
|
LCD1602_DATAPINS = dat; /* 写入数据 */
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
|
||||||
|
LCD1602_E = 1; /* 写入时序 */
|
||||||
|
Lcd1602_Delay1ms(5);
|
||||||
|
LCD1602_E = 0;
|
||||||
|
}
|
||||||
|
#else /* 4位数据线模式 */
|
||||||
|
void LcdWriteData(uchar dat)
|
||||||
|
{
|
||||||
|
LCD1602_E = 0;
|
||||||
|
LCD1602_RS = 1;
|
||||||
|
LCD1602_RW = 0;
|
||||||
|
|
||||||
|
LCD1602_DATAPINS = dat; /* 写入高4位 */
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
|
||||||
|
LCD1602_E = 1;
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_E = 0;
|
||||||
|
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_DATAPINS = dat << 4; /* 写入低4位 */
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
|
||||||
|
LCD1602_E = 1;
|
||||||
|
Lcd1602_Delay1ms(1);
|
||||||
|
LCD1602_E = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 函数名:LcdInit
|
||||||
|
* 功能 :初始化LCD1602液晶
|
||||||
|
* 输入 :无
|
||||||
|
* 输出 :无
|
||||||
|
*/
|
||||||
|
#ifndef LCD1602_4PINS /* 8位数据线模式 */
|
||||||
|
void LcdInit()
|
||||||
|
{
|
||||||
|
LcdWriteCom(0x38); /* 设置显示模式:16x2, 5x7点阵, 8位 */
|
||||||
|
LcdWriteCom(0x0c); /* 开显示,不显示光标 */
|
||||||
|
LcdWriteCom(0x06); /* 写入数据后地址自动加1 */
|
||||||
|
LcdWriteCom(0x01); /* 清屏 */
|
||||||
|
LcdWriteCom(0x80); /* 设置DDRAM地址为0x00(第一行起始) */
|
||||||
|
}
|
||||||
|
#else /* 4位数据线模式 */
|
||||||
|
void LcdInit()
|
||||||
|
{
|
||||||
|
LcdWriteCom(0x32); /* 从8位模式转换为4位模式 */
|
||||||
|
LcdWriteCom(0x28); /* 4位模式下的初始化 */
|
||||||
|
LcdWriteCom(0x0c); /* 开显示,不显示光标 */
|
||||||
|
LcdWriteCom(0x06); /* 写入数据后地址自动加1 */
|
||||||
|
LcdWriteCom(0x01); /* 清屏 */
|
||||||
|
LcdWriteCom(0x80); /* 设置DDRAM地址为0x00(第一行起始) */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef __LCD_H_
|
||||||
|
#define __LCD_H_
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 使用4位数据线时取消注释 LCD1602_4PINS,
|
||||||
|
* 使用8位数据线时注释掉即可
|
||||||
|
*/
|
||||||
|
#define LCD1602_4PINS
|
||||||
|
|
||||||
|
/* 包含头文件 */
|
||||||
|
#include<reg51.h>
|
||||||
|
|
||||||
|
/* 数据类型重定义 */
|
||||||
|
#ifndef uchar
|
||||||
|
#define uchar unsigned char
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef uint
|
||||||
|
#define uint unsigned int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 引脚定义 */
|
||||||
|
#define LCD1602_DATAPINS P0 /* LCD数据口 */
|
||||||
|
sbit LCD1602_E=P2^7; /* 使能信号 */
|
||||||
|
sbit LCD1602_RW=P2^5; /* 读写选择 */
|
||||||
|
sbit LCD1602_RS=P2^6; /* 指令/数据选择 */
|
||||||
|
|
||||||
|
/* 函数声明 */
|
||||||
|
void Lcd1602_Delay1ms(uint c); /* 延时函数(12MHz) */
|
||||||
|
void LcdWriteCom(uchar com); /* 写命令 */
|
||||||
|
void LcdWriteData(uchar dat); /* 写数据 */
|
||||||
|
void LcdInit(); /* 初始化LCD */
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,643 @@
|
|||||||
|
#include<reg51.h>
|
||||||
|
#include<intrins.h>
|
||||||
|
#include"lcd.h"
|
||||||
|
#include"ds1302.h"
|
||||||
|
#include"ds18b20.h"
|
||||||
|
|
||||||
|
/* 按键引脚定义 */
|
||||||
|
sbit K1=P3^1; /* 模式/确认键 */
|
||||||
|
sbit K2=P3^0; /* 切换/返回键 */
|
||||||
|
sbit K3=P3^2; /* 加/开始暂停键 */
|
||||||
|
sbit K4=P3^3; /* 减/复位键 */
|
||||||
|
sbit Buzzer=P2^0; /* 蜂鸣器引脚 */
|
||||||
|
|
||||||
|
/* 函数声明 */
|
||||||
|
void Delay10ms(void);
|
||||||
|
void LcdFramework(void);
|
||||||
|
void LcdUpdate(void);
|
||||||
|
void TempPros(void);
|
||||||
|
void KeyScan(void);
|
||||||
|
void SetAlarm(void);
|
||||||
|
void AlarmJudge(void);
|
||||||
|
void AlarmBuzPro(void);
|
||||||
|
void Timer1Init(void);
|
||||||
|
void KeySound(void);
|
||||||
|
void ReturnSound(void);
|
||||||
|
void DelayMs(unsigned int ms);
|
||||||
|
|
||||||
|
/* 全局变量 */
|
||||||
|
unsigned char mode = 0; /* 模式: 0=时钟, 2=秒表 */
|
||||||
|
unsigned char last_mode = 0xFF; /* 上一次模式,用于检测模式切换 */
|
||||||
|
int temperature = 0; /* 温度值(10倍) */
|
||||||
|
unsigned char temp_cnt = 0; /* 温度采集计数 */
|
||||||
|
|
||||||
|
/* 闹钟参数 */
|
||||||
|
unsigned char alarm_hour = 6; /* 闹钟小时 */
|
||||||
|
unsigned char alarm_min = 0; /* 闹钟分钟 */
|
||||||
|
unsigned char alarm_on = 0; /* 闹钟开关 */
|
||||||
|
unsigned char alarm_buz = 0; /* 闹钟蜂鸣标志 */
|
||||||
|
unsigned char alarm_buz_cnt = 0; /* 闹钟蜂鸣计数 */
|
||||||
|
|
||||||
|
/* 秒表参数 */
|
||||||
|
unsigned int sw_sec = 0; /* 秒表秒数 */
|
||||||
|
unsigned char sw_csec = 0; /* 秒表百分秒 */
|
||||||
|
bit sw_running = 0; /* 秒表运行状态 */
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
Timer1Init(); /* 初始化定时器1 */
|
||||||
|
LcdInit(); /* 初始化LCD1602 */
|
||||||
|
|
||||||
|
/* 开机蜂鸣器响一声 */
|
||||||
|
Buzzer = 0;
|
||||||
|
Delay10ms();Delay10ms();Delay10ms();Delay10ms();Delay10ms();
|
||||||
|
Delay10ms();Delay10ms();Delay10ms();Delay10ms();Delay10ms();
|
||||||
|
Buzzer = 1;
|
||||||
|
|
||||||
|
Ds1302Init(); /* 初始化DS1302 */
|
||||||
|
DS18B20_SetResolution(0x3F); /* 设置DS18B20分辨率10位 */
|
||||||
|
DS18B20_StartConvert(); /* 启动温度转换 */
|
||||||
|
|
||||||
|
/* 从DS1302 RAM读取闹钟参数 */
|
||||||
|
alarm_hour = Ds1302Read(0xC1);
|
||||||
|
if(alarm_hour > 23) alarm_hour = 6;
|
||||||
|
alarm_min = Ds1302Read(0xC3);
|
||||||
|
if(alarm_min > 59) alarm_min = 0;
|
||||||
|
alarm_on = Ds1302Read(0xC5);
|
||||||
|
if(alarm_on > 1) alarm_on = 0;
|
||||||
|
|
||||||
|
/* 主循环 */
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
Ds1302ReadTime(); /* 读取DS1302时间 */
|
||||||
|
|
||||||
|
/* 每5个循环采集一次温度 */
|
||||||
|
temp_cnt++;
|
||||||
|
if(temp_cnt >= 5)
|
||||||
|
{
|
||||||
|
temp_cnt = 0;
|
||||||
|
TempPros();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 模式切换时刷新LCD框架 */
|
||||||
|
if(mode != last_mode)
|
||||||
|
{
|
||||||
|
LcdFramework();
|
||||||
|
last_mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
AlarmJudge(); /* 闹钟判断 */
|
||||||
|
AlarmBuzPro(); /* 闹钟蜂鸣处理 */
|
||||||
|
KeyScan(); /* 按键扫描 */
|
||||||
|
LcdUpdate(); /* LCD显示更新 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 在LCD上显示两位数字 */
|
||||||
|
void ShowLcdNum(unsigned char num)
|
||||||
|
{
|
||||||
|
LcdWriteData('0' + num / 10); /* 十位 */
|
||||||
|
LcdWriteData('0' + num % 10); /* 个位 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 在LCD上显示星期(英文缩写) */
|
||||||
|
void ShowLcdWeek(unsigned char week)
|
||||||
|
{
|
||||||
|
switch(week)
|
||||||
|
{
|
||||||
|
case 1: LcdWriteData('S'); LcdWriteData('u'); LcdWriteData('n'); break; /* Sunday */
|
||||||
|
case 2: LcdWriteData('M'); LcdWriteData('o'); LcdWriteData('n'); break; /* Monday */
|
||||||
|
case 3: LcdWriteData('T'); LcdWriteData('u'); LcdWriteData('e'); break; /* Tuesday */
|
||||||
|
case 4: LcdWriteData('W'); LcdWriteData('e'); LcdWriteData('d'); break; /* Wednesday */
|
||||||
|
case 5: LcdWriteData('T'); LcdWriteData('h'); LcdWriteData('u'); break; /* Thursday */
|
||||||
|
case 6: LcdWriteData('F'); LcdWriteData('r'); LcdWriteData('i'); break; /* Friday */
|
||||||
|
case 7: LcdWriteData('S'); LcdWriteData('a'); LcdWriteData('t'); break; /* Saturday */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* LCD界面框架绘制 */
|
||||||
|
void LcdFramework()
|
||||||
|
{
|
||||||
|
if(mode == 0) /* 时钟模式界面 */
|
||||||
|
{
|
||||||
|
LcdWriteCom(0x0c); /* 不显示光标 */
|
||||||
|
|
||||||
|
/* 第一行:20 - - */
|
||||||
|
LcdWriteCom(0x80);
|
||||||
|
LcdWriteData('2'); LcdWriteData('0');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData('-');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData('-');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
|
||||||
|
/* 第二行: : : 温度 */
|
||||||
|
LcdWriteCom(0x80+0x40);
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(':');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(':');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
}
|
||||||
|
else if(mode == 2) /* 秒表模式界面 */
|
||||||
|
{
|
||||||
|
LcdWriteCom(0x0c); /* 不显示光标 */
|
||||||
|
|
||||||
|
/* 第一行:显示 Stop Watch 标题 */
|
||||||
|
LcdWriteCom(0x80);
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData('S'); LcdWriteData('t'); LcdWriteData('o');
|
||||||
|
LcdWriteData('p'); LcdWriteData(' ');
|
||||||
|
LcdWriteData('W'); LcdWriteData('a'); LcdWriteData('t');
|
||||||
|
LcdWriteData('c'); LcdWriteData('h');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
|
||||||
|
/* 第二行: : : . */
|
||||||
|
LcdWriteCom(0x80+0x40);
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(':'); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(':');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData('.');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* LCD显示数据更新 */
|
||||||
|
void LcdUpdate()
|
||||||
|
{
|
||||||
|
unsigned char t;
|
||||||
|
int temp_disp;
|
||||||
|
|
||||||
|
if(mode == 0) /* 时钟模式 */
|
||||||
|
{
|
||||||
|
/* 显示年(BCD码转十进制) */
|
||||||
|
LcdWriteCom(0x82);
|
||||||
|
ShowLcdNum((TIME[6]>>4)*10 + (TIME[6]&0x0f));
|
||||||
|
|
||||||
|
/* 显示月 */
|
||||||
|
LcdWriteCom(0x85);
|
||||||
|
ShowLcdNum((TIME[4]>>4)*10 + (TIME[4]&0x0f));
|
||||||
|
|
||||||
|
/* 显示日 */
|
||||||
|
LcdWriteCom(0x88);
|
||||||
|
ShowLcdNum((TIME[3]>>4)*10 + (TIME[3]&0x0f));
|
||||||
|
|
||||||
|
/* 显示星期 */
|
||||||
|
LcdWriteCom(0x8C);
|
||||||
|
ShowLcdWeek(TIME[5] & 0x07);
|
||||||
|
|
||||||
|
/* 显示时 */
|
||||||
|
LcdWriteCom(0xC0);
|
||||||
|
ShowLcdNum((TIME[2]>>4)*10 + (TIME[2]&0x0f));
|
||||||
|
|
||||||
|
/* 显示分 */
|
||||||
|
LcdWriteCom(0xC3);
|
||||||
|
ShowLcdNum((TIME[1]>>4)*10 + (TIME[1]&0x0f));
|
||||||
|
|
||||||
|
/* 显示秒 */
|
||||||
|
LcdWriteCom(0xC6);
|
||||||
|
ShowLcdNum((TIME[0]>>4)*10 + (TIME[0]&0x0f));
|
||||||
|
|
||||||
|
/* 显示温度,如 -12.3C */
|
||||||
|
LcdWriteCom(0xC9);
|
||||||
|
temp_disp = temperature;
|
||||||
|
if(temp_disp < 0) { LcdWriteData('-'); temp_disp = -temp_disp; }
|
||||||
|
else { LcdWriteData(' '); }
|
||||||
|
LcdWriteData('0' + temp_disp / 100);
|
||||||
|
LcdWriteData('0' + (temp_disp / 10) % 10);
|
||||||
|
LcdWriteData('.');
|
||||||
|
LcdWriteData('0' + temp_disp % 10);
|
||||||
|
LcdWriteData('C');
|
||||||
|
}
|
||||||
|
else if(mode == 2) /* 秒表模式 */
|
||||||
|
{
|
||||||
|
/* 显示时 */
|
||||||
|
t = sw_sec / 3600;
|
||||||
|
LcdWriteCom(0xC0);
|
||||||
|
LcdWriteData('0' + t / 10);
|
||||||
|
LcdWriteData('0' + t % 10);
|
||||||
|
|
||||||
|
/* 显示分 */
|
||||||
|
LcdWriteCom(0xC3);
|
||||||
|
t = (sw_sec % 3600) / 60;
|
||||||
|
LcdWriteData('0' + t / 10);
|
||||||
|
LcdWriteData('0' + t % 10);
|
||||||
|
|
||||||
|
/* 显示秒 */
|
||||||
|
LcdWriteCom(0xC6);
|
||||||
|
LcdWriteData('0' + (sw_sec % 60) / 10);
|
||||||
|
LcdWriteData('0' + (sw_sec % 60) % 10);
|
||||||
|
|
||||||
|
/* 显示百分秒 */
|
||||||
|
LcdWriteCom(0xC9);
|
||||||
|
LcdWriteData('0' + sw_csec / 10);
|
||||||
|
LcdWriteData('0' + sw_csec % 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按键扫描处理 */
|
||||||
|
void KeyScan()
|
||||||
|
{
|
||||||
|
if(mode == 0) /* 时钟模式下的按键 */
|
||||||
|
{
|
||||||
|
/* K1:进入闹钟设置 */
|
||||||
|
if(K1 == 0)
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K1 == 0)
|
||||||
|
{
|
||||||
|
while(!K1);
|
||||||
|
SetAlarm();
|
||||||
|
last_mode = 0xFF; /* 强制刷新界面 */
|
||||||
|
ReturnSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* K2:进入秒表模式 */
|
||||||
|
if(K2 == 0)
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K2 == 0)
|
||||||
|
{
|
||||||
|
while(!K2);
|
||||||
|
KeySound();
|
||||||
|
mode = 2;
|
||||||
|
sw_running = 0; /* 秒表停止 */
|
||||||
|
sw_sec = 0; /* 秒表归零 */
|
||||||
|
sw_csec = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(mode == 2) /* 秒表模式下的按键 */
|
||||||
|
{
|
||||||
|
/* K3:开始/暂停秒表 */
|
||||||
|
if(K3 == 0)
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K3 == 0)
|
||||||
|
{
|
||||||
|
while(!K3);
|
||||||
|
KeySound();
|
||||||
|
sw_running = !sw_running; /* 切换运行状态 */
|
||||||
|
TR1 = sw_running; /* 控制定时器启停 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* K4:秒表复位(仅在停止时有效) */
|
||||||
|
if(K4 == 0)
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K4 == 0)
|
||||||
|
{
|
||||||
|
while(!K4);
|
||||||
|
KeySound();
|
||||||
|
if(!sw_running)
|
||||||
|
{
|
||||||
|
sw_sec = 0; /* 秒表归零 */
|
||||||
|
sw_csec = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* K2:返回时钟模式 */
|
||||||
|
if(K2 == 0)
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K2 == 0)
|
||||||
|
{
|
||||||
|
while(!K2);
|
||||||
|
mode = 0;
|
||||||
|
TR1 = 0; /* 关闭定时器 */
|
||||||
|
sw_running = 0;
|
||||||
|
sw_sec = 0;
|
||||||
|
sw_csec = 0;
|
||||||
|
ReturnSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 闹钟设置功能 */
|
||||||
|
void SetAlarm()
|
||||||
|
{
|
||||||
|
/* 显示闹钟设置界面标题 */
|
||||||
|
LcdWriteCom(0x80);
|
||||||
|
LcdWriteData('A'); LcdWriteData('l'); LcdWriteData('a'); LcdWriteData('r');
|
||||||
|
LcdWriteData('m'); LcdWriteData(' '); LcdWriteData('C'); LcdWriteData('l');
|
||||||
|
LcdWriteData('o'); LcdWriteData('c'); LcdWriteData('k'); LcdWriteData(' ');
|
||||||
|
LcdWriteData('S'); LcdWriteData('e'); LcdWriteData('t'); LcdWriteData(' ');
|
||||||
|
|
||||||
|
/* 显示时间占位符 */
|
||||||
|
LcdWriteCom(0xC0);
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(':'); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' '); LcdWriteData(' ');
|
||||||
|
|
||||||
|
/* 显示当前闹钟小时 */
|
||||||
|
LcdWriteCom(0xC3);
|
||||||
|
LcdWriteData('0' + alarm_hour / 10);
|
||||||
|
LcdWriteData('0' + alarm_hour % 10);
|
||||||
|
|
||||||
|
/* 显示当前闹钟分钟 */
|
||||||
|
LcdWriteCom(0xC6);
|
||||||
|
LcdWriteData('0' + alarm_min / 10);
|
||||||
|
LcdWriteData('0' + alarm_min % 10);
|
||||||
|
|
||||||
|
/* 显示闹钟开关状态 */
|
||||||
|
LcdWriteCom(0xCA);
|
||||||
|
if(alarm_on) { LcdWriteData(' '); LcdWriteData('O'); LcdWriteData('N'); }
|
||||||
|
else { LcdWriteData('O'); LcdWriteData('F'); LcdWriteData('F'); }
|
||||||
|
|
||||||
|
/* 设置闹钟小时 */
|
||||||
|
LcdWriteCom(0xC4);
|
||||||
|
LcdWriteCom(0x0f); /* 显示光标 */
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
if(K3 == 0) /* K3加 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K3 == 0)
|
||||||
|
{
|
||||||
|
while(!K3);
|
||||||
|
KeySound();
|
||||||
|
if(alarm_hour < 23) alarm_hour++; else alarm_hour = 0;
|
||||||
|
LcdWriteCom(0xC3);
|
||||||
|
LcdWriteData('0' + alarm_hour / 10);
|
||||||
|
LcdWriteData('0' + alarm_hour % 10);
|
||||||
|
LcdWriteCom(0xC4);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K4 == 0) /* K4减 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K4 == 0)
|
||||||
|
{
|
||||||
|
while(!K4);
|
||||||
|
KeySound();
|
||||||
|
if(alarm_hour > 0) alarm_hour--; else alarm_hour = 23;
|
||||||
|
LcdWriteCom(0xC3);
|
||||||
|
LcdWriteData('0' + alarm_hour / 10);
|
||||||
|
LcdWriteData('0' + alarm_hour % 10);
|
||||||
|
LcdWriteCom(0xC4);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K1 == 0) /* K1确认 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K1 == 0)
|
||||||
|
{
|
||||||
|
while(!K1);
|
||||||
|
KeySound();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置闹钟分钟 */
|
||||||
|
LcdWriteCom(0xC7);
|
||||||
|
LcdWriteCom(0x0f); /* 显示光标 */
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
if(K3 == 0) /* K3加 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K3 == 0)
|
||||||
|
{
|
||||||
|
while(!K3);
|
||||||
|
KeySound();
|
||||||
|
if(alarm_min < 59) alarm_min++; else alarm_min = 0;
|
||||||
|
LcdWriteCom(0xC6);
|
||||||
|
LcdWriteData('0' + alarm_min / 10);
|
||||||
|
LcdWriteData('0' + alarm_min % 10);
|
||||||
|
LcdWriteCom(0xC7);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K4 == 0) /* K4减 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K4 == 0)
|
||||||
|
{
|
||||||
|
while(!K4);
|
||||||
|
KeySound();
|
||||||
|
if(alarm_min > 0) alarm_min--; else alarm_min = 59;
|
||||||
|
LcdWriteCom(0xC6);
|
||||||
|
LcdWriteData('0' + alarm_min / 10);
|
||||||
|
LcdWriteData('0' + alarm_min % 10);
|
||||||
|
LcdWriteCom(0xC7);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K1 == 0) /* K1确认 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K1 == 0)
|
||||||
|
{
|
||||||
|
while(!K1);
|
||||||
|
KeySound();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置闹钟开关 */
|
||||||
|
LcdWriteCom(0xCC);
|
||||||
|
LcdWriteCom(0x0f); /* 显示光标 */
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
if(K3 == 0) /* K3:开启闹钟 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K3 == 0)
|
||||||
|
{
|
||||||
|
while(!K3);
|
||||||
|
KeySound();
|
||||||
|
alarm_on = 1;
|
||||||
|
LcdWriteCom(0xCA);
|
||||||
|
LcdWriteData(' '); LcdWriteData('O'); LcdWriteData('N');
|
||||||
|
LcdWriteCom(0xCC);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K4 == 0) /* K4:关闭闹钟 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K4 == 0)
|
||||||
|
{
|
||||||
|
while(!K4);
|
||||||
|
KeySound();
|
||||||
|
alarm_on = 0;
|
||||||
|
LcdWriteCom(0xCA);
|
||||||
|
LcdWriteData('O'); LcdWriteData('F'); LcdWriteData('F');
|
||||||
|
LcdWriteCom(0xCC);
|
||||||
|
LcdWriteCom(0x0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(K1 == 0) /* K1确认退出 */
|
||||||
|
{
|
||||||
|
Delay10ms();
|
||||||
|
if(K1 == 0)
|
||||||
|
{
|
||||||
|
while(!K1);
|
||||||
|
KeySound();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 退出设置,保存闹钟参数到DS1302 RAM */
|
||||||
|
LcdWriteCom(0x0c); /* 关闭光标 */
|
||||||
|
Ds1302Write(0x8E, 0x00); /* 允许写DS1302 */
|
||||||
|
Ds1302Write(0xC0, alarm_hour); /* 保存小时到RAM */
|
||||||
|
Ds1302Write(0xC2, alarm_min); /* 保存分钟到RAM */
|
||||||
|
Ds1302Write(0xC4, alarm_on); /* 保存开关状态到RAM */
|
||||||
|
Ds1302Write(0x8E, 0x80); /* 禁止写DS1302 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 闹钟判断 */
|
||||||
|
void AlarmJudge()
|
||||||
|
{
|
||||||
|
unsigned char h, m, s;
|
||||||
|
h = (TIME[2] >> 4) * 10 + (TIME[2] & 0x0f); /* 当前小时 */
|
||||||
|
m = (TIME[1] >> 4) * 10 + (TIME[1] & 0x0f); /* 当前分钟 */
|
||||||
|
s = (TIME[0] >> 4) * 10 + (TIME[0] & 0x0f); /* 当前秒 */
|
||||||
|
|
||||||
|
/* 闹钟响铃中:每分钟的0秒检查是否超时 */
|
||||||
|
if(alarm_buz)
|
||||||
|
{
|
||||||
|
if(s == 0)
|
||||||
|
{
|
||||||
|
alarm_buz_cnt++;
|
||||||
|
if(alarm_buz_cnt > 50) /* 超过50分钟则停止响铃 */
|
||||||
|
{
|
||||||
|
alarm_buz_cnt = 0;
|
||||||
|
alarm_buz = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 到达闹钟时间且前3秒触发响铃 */
|
||||||
|
if(alarm_on && h == alarm_hour && m == alarm_min && s >= 0 && s < 3)
|
||||||
|
{
|
||||||
|
if(!alarm_buz) alarm_buz = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 到达59秒时关闭闹钟 */
|
||||||
|
if(s == 59)
|
||||||
|
alarm_buz = 0;
|
||||||
|
|
||||||
|
/* 按任意键关闭闹钟 */
|
||||||
|
if(K1 == 0 || K2 == 0)
|
||||||
|
{
|
||||||
|
alarm_buz = 0;
|
||||||
|
Buzzer = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 闹钟蜂鸣处理(蜂鸣器交替响) */
|
||||||
|
void AlarmBuzPro()
|
||||||
|
{
|
||||||
|
if(alarm_buz)
|
||||||
|
{
|
||||||
|
Buzzer = 0;
|
||||||
|
DelayMs(50);
|
||||||
|
Buzzer = 1;
|
||||||
|
DelayMs(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 定时器1初始化(用于秒表) */
|
||||||
|
void Timer1Init()
|
||||||
|
{
|
||||||
|
TMOD &= 0x0F; /* 清除T1位 */
|
||||||
|
TMOD |= 0x10; /* 设置T1为模式1(16位定时器) */
|
||||||
|
ET1 = 1; /* 使能T1中断 */
|
||||||
|
EA = 1; /* 开总中断 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 定时器1中断服务函数(约10ms中断一次) */
|
||||||
|
void Timer1() interrupt 3
|
||||||
|
{
|
||||||
|
TH1 = 0xD8; /* 重装初值 */
|
||||||
|
TL1 = 0xF0;
|
||||||
|
|
||||||
|
if(sw_running) /* 秒表运行时 */
|
||||||
|
{
|
||||||
|
sw_csec++;
|
||||||
|
if(sw_csec >= 100) /* 百分秒满100进1秒 */
|
||||||
|
{
|
||||||
|
sw_csec = 0;
|
||||||
|
sw_sec++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 温度处理:读取DS18B20并转换为10倍温度值 */
|
||||||
|
void TempPros()
|
||||||
|
{
|
||||||
|
int raw;
|
||||||
|
unsigned char sign = 0;
|
||||||
|
|
||||||
|
if(!DS18B20_GetTemp(&raw)) /* 读取原始温度 */
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(raw & 0x8000) /* 负温度处理 */
|
||||||
|
{
|
||||||
|
raw = ~raw + 1;
|
||||||
|
sign = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
temperature = raw * 10 / 16; /* 转换为10倍温度值 */
|
||||||
|
if(sign)
|
||||||
|
temperature = -temperature;
|
||||||
|
|
||||||
|
DS18B20_StartConvert(); /* 启动下一次温度转换 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 毫秒延时函数(12MHz晶振) */
|
||||||
|
void DelayMs(unsigned int ms)
|
||||||
|
{
|
||||||
|
unsigned int i, j;
|
||||||
|
for(i=0; i<ms; i++)
|
||||||
|
for(j=0; j<112; j++);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按键提示音(短响一声) */
|
||||||
|
void KeySound()
|
||||||
|
{
|
||||||
|
Buzzer = 0;
|
||||||
|
DelayMs(40);
|
||||||
|
Buzzer = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 返回提示音(短响两声) */
|
||||||
|
void ReturnSound()
|
||||||
|
{
|
||||||
|
Buzzer = 0;
|
||||||
|
DelayMs(40);
|
||||||
|
Buzzer = 1;
|
||||||
|
DelayMs(30);
|
||||||
|
Buzzer = 0;
|
||||||
|
DelayMs(40);
|
||||||
|
Buzzer = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 10ms延时函数(12MHz晶振) */
|
||||||
|
void Delay10ms(void)
|
||||||
|
{
|
||||||
|
unsigned char a,b,c;
|
||||||
|
for(c=1;c>0;c--)
|
||||||
|
for(b=38;b>0;b--)
|
||||||
|
for(a=130;a>0;a--);
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,239 @@
|
|||||||
|
:030000000207965E
|
||||||
|
:0C079600787FE4F6D8FD7581200207DDB5
|
||||||
|
:100ABE00010A00010FFF020D0000011200010B06DA
|
||||||
|
:100ACE00010C0001110001100001130002080000CA
|
||||||
|
:050ADE00011400C1003D
|
||||||
|
:10070400120C96120BEDC2A0120C71120C71120C89
|
||||||
|
:1007140071120C71120C71120C71120C71120C7199
|
||||||
|
:10072400120C71120C71D2A0120AED7F3F120B8DC4
|
||||||
|
:10073400120CA17FC11209F68F0BE50BD39417405D
|
||||||
|
:1007440003750B067FC31209F68F0CE50CD3943B9B
|
||||||
|
:100754004003E4F50C7FC51209F68F11E511D3941B
|
||||||
|
:10076400014003E4F511120C280512E512C39405A7
|
||||||
|
:100774004006E4F5121209A9E50A650F60061204A1
|
||||||
|
:10078400F2850A0F1209341200031208AE12032371
|
||||||
|
:0207940080D40F
|
||||||
|
:040BAE00540F2FFFB2
|
||||||
|
:100BB2008F1FE51F75F00A842430FF120C8AE51F8F
|
||||||
|
:0C0BC20075F00A84E5F02430FF020C8A74
|
||||||
|
:10082200EF14B4070040030208AD90083A75F003D4
|
||||||
|
:10083200A4C58325F0C5837302084F020858020835
|
||||||
|
:100842006602087402088202089002089E7F531210
|
||||||
|
:100852000C8A7F7580077F4D120C8A7F6F120C8A7B
|
||||||
|
:100862007F6E80447F54120C8A7F75120C8A7F65DA
|
||||||
|
:1008720080367F57120C8A7F65120C8A7F6480282B
|
||||||
|
:100882007F54120C8A7F68120C8A7F75801A7F4609
|
||||||
|
:10089200120C8A7F72120C8A7F69800C7F53120CB1
|
||||||
|
:0C08A2008A7F61120C8A7F74120C8A227B
|
||||||
|
:1004F200E50A600302058A7F0C120C7E7F80120CD3
|
||||||
|
:100502007E7F32120C8A7F30120C8A7F20120C8A74
|
||||||
|
:100512007F20120C8A7F2D120C8A7F20120C8A7F78
|
||||||
|
:1005220020120C8A7F2D120C8A7F20120C8A7F20C7
|
||||||
|
:10053200120C8A7F20120C8A7F20120C8A7F2012D2
|
||||||
|
:100542000C8A7F20120C8A7F20120C8A7F20120CC8
|
||||||
|
:100552008A7FC0120C7E7F20120C8A7F20120C8AA6
|
||||||
|
:100562007F3A120C8A7F20120C8A7F20120C8A7F1B
|
||||||
|
:100572003A120C8A7F20120C8A7F20120C8A7F206A
|
||||||
|
:10058200120C8A7F2002061CE50A6402600302063E
|
||||||
|
:10059200477F0C120C7E7F80120C7E7F20120C8A09
|
||||||
|
:1005A2007F20120C8A7F20120C8A7F53120C8A7FC2
|
||||||
|
:1005B20074120C8A7F6F120C8A7F70120C8A7F2051
|
||||||
|
:1005C200120C8A7F57120C8A7F61120C8A7F741276
|
||||||
|
:1005D2000C8A7F63120C8A7F68120C8A7F20120CAD
|
||||||
|
:1005E2008A7F20120C8A7F20120C8A7FC0120C7E16
|
||||||
|
:1005F2007F20120C8A7F20120C8A7F3A120C8A7F8B
|
||||||
|
:1006020020120C8A7F20120C8A7F3A120C8A7F20D9
|
||||||
|
:10061200120C8A7F20120C8A7F2E120C8A7F2012E3
|
||||||
|
:100622000C8A7F20120C8A7F20120C8A7F20120CE7
|
||||||
|
:100632008A7F20120C8A7F20120C8A7F20120C8A59
|
||||||
|
:060642007F20120C8A2249
|
||||||
|
:10032300E50A60030204217F82120C7EE51BC4549C
|
||||||
|
:100333000F75F00AA4FFE51B120BAE7F85120C7E2E
|
||||||
|
:10034300E519C4540F75F00AA4FFE519120BAE7F2B
|
||||||
|
:1003530088120C7EE518C4540F75F00AA4FFE51843
|
||||||
|
:10036300120BAE7F8C120C7EE51A5407FF12082283
|
||||||
|
:100373007FC0120C7EE517C4540F75F00AA4FFE585
|
||||||
|
:1003830017120BAE7FC3120C7EE516C4540F75F023
|
||||||
|
:100393000AA4FFE516120BAE7FC6120C7EE515C448
|
||||||
|
:1003A300540F75F00AA4FFE515120BAE7FC9120CAA
|
||||||
|
:1003B3007E850D1D850E1EC3E51D6480948050123D
|
||||||
|
:1003C3007F2D120C8AC3E4951EF51EE4951DF51DC1
|
||||||
|
:1003D30080057F20120C8AAE1DAF1E7C007D641247
|
||||||
|
:1003E30006AFEF2430FF120C8AAE1DAF1E7C007DDA
|
||||||
|
:1003F3000A1206AF7C007D0A1206AFED2430FF120D
|
||||||
|
:100403000C8A7F2E120C8AAE1DAF1E7C007D0A1251
|
||||||
|
:1004130006AFED2430FF120C8A7F430204EEE50A97
|
||||||
|
:10042300640260030204F1AE08AF097C0E7D101272
|
||||||
|
:10043300065A8F1C7FC0120C7EE51C75F00A8424BB
|
||||||
|
:1004430030FF120C8AE51C75F00A84E5F02430FFB6
|
||||||
|
:10045300120C8A7FC3120C7EAE08AF097C0E7D108E
|
||||||
|
:1004630012065A7E007F3CCFCDCFCECCCE12065A99
|
||||||
|
:100473008F1CE51C75F00A842430FF120C8AE51CDE
|
||||||
|
:1004830075F00A84E5F02430FF120C8A7FC6120C43
|
||||||
|
:100493007EAE08AF097C007D3C12065A7E007F0ABF
|
||||||
|
:1004A300CFCDCFCECCCE12065AEF2430FF120C8A1A
|
||||||
|
:1004B300AE08AF097C007D3C12065A7E007F0ACF4E
|
||||||
|
:1004C300CDCFCECCCE12065AED2430FF120C8A7F4C
|
||||||
|
:1004D300C9120C7EE51475F00A842430FF120C8ACD
|
||||||
|
:0E04E300E51475F00A84E5F02430FF120C8A4F
|
||||||
|
:0104F10022E8
|
||||||
|
:1008AE00E50A703120B112120C7120B10C30B1FD7D
|
||||||
|
:1008BE0012001E750FFF120C3E20B069120C712033
|
||||||
|
:1008CE00B06330B0FD120CA9750A02C200E4F5083F
|
||||||
|
:1008DE00F509F51422E50A6402704A20B212120CD0
|
||||||
|
:1008EE007120B20C30B2FD120CA9B200A200928E91
|
||||||
|
:1008FE0020B316120C7120B31030B3FD120CA920C8
|
||||||
|
:10090E000007E4F508F509F51420B019120C712052
|
||||||
|
:10091E00B01330B0FDE4F50AC28EC200F508F50939
|
||||||
|
:06092E00F514120C3E223C
|
||||||
|
:10001E007F80120C7E7F41120C8A7F6C120C8A7FBD
|
||||||
|
:10002E0061120C8A7F72120C8A7F6D120C8A7F20ED
|
||||||
|
:10003E00120C8A7F43120C8A7F6C120C8A7F6F120D
|
||||||
|
:10004E000C8A7F63120C8A7F6B120C8A7F20120C33
|
||||||
|
:10005E008A7F53120C8A7F65120C8A7F74120C8A67
|
||||||
|
:10006E007F20120C8A7FC0120C7E7F20120C8A7F9A
|
||||||
|
:10007E0020120C8A7F20120C8A7F20120C8A7F207D
|
||||||
|
:10008E00120C8A7F3A120C8A7F20120C8A7F201261
|
||||||
|
:10009E000C8A7F20120C8A7F20120C8A7F20120C71
|
||||||
|
:1000AE008A7F20120C8A7F20120C8A7F20120C8AE3
|
||||||
|
:1000BE007F20120C8A7F20120C8A7FC3120C7EE5E1
|
||||||
|
:1000CE000B75F00A842430FF120C8AE50B75F00ACA
|
||||||
|
:1000DE0084E5F02430FF120C8A7FC6120C7EE50CEC
|
||||||
|
:1000EE0075F00A842430FF120C8AE50C75F00A8430
|
||||||
|
:1000FE00E5F02430FF120C8A7FCA120C7EE51160E7
|
||||||
|
:10010E000E7F20120C8A7F4F120C8A7F4E800C7F3E
|
||||||
|
:10011E004F120C8A7F46120C8A7F46120C8A7FC4BD
|
||||||
|
:10012E00120C7E7F0F120C7E20B243120C7120B285
|
||||||
|
:10013E003D30B2FD120CA9E50BC394175004050B0C
|
||||||
|
:10014E008003E4F50B7FC3120C7EE50B75F00A8479
|
||||||
|
:10015E002430FF120C8AE50B75F00A84E5F024308A
|
||||||
|
:10016E00FF120C8A7FC4120C7E7F0F120C7E20B3FE
|
||||||
|
:10017E0043120C7120B33D30B3FD120CA9E50BD325
|
||||||
|
:10018E0094004004150B8003750B177FC3120C7E71
|
||||||
|
:10019E00E50B75F00A842430FF120C8AE50B75F01E
|
||||||
|
:1001AE000A84E5F02430FF120C8A7FC4120C7E7F85
|
||||||
|
:1001BE000F120C7E30B103020136120C7130B103F6
|
||||||
|
:1001CE0002013630B1FD120CA97FC7120C7E7F0FD3
|
||||||
|
:1001DE00120C7E20B243120C7120B23D30B2FD12D1
|
||||||
|
:1001EE000CA9E50CC3943B5004050C8003E4F50CFC
|
||||||
|
:1001FE007FC6120C7EE50C75F00A842430FF120CBB
|
||||||
|
:10020E008AE50C75F00A84E5F02430FF120C8A7F23
|
||||||
|
:10021E00C7120C7E7F0F120C7E20B343120C71207E
|
||||||
|
:10022E00B33D30B3FD120CA9E50CD3940040041578
|
||||||
|
:10023E000C8003750C3B7FC6120C7EE50C75F00A24
|
||||||
|
:10024E00842430FF120C8AE50C75F00A84E5F02444
|
||||||
|
:10025E0030FF120C8A7FC7120C7E7F0F120C7E307D
|
||||||
|
:10026E00B1030201E1120C7130B1030201E130B1B0
|
||||||
|
:10027E00FD120CA97FCC120C7E7F0F120C7E20B2C9
|
||||||
|
:10028E002D120C7120B22730B2FD120CA97511017E
|
||||||
|
:10029E007FCA120C7E7F20120C8A7F4F120C8A7F2F
|
||||||
|
:1002AE004E120C8A7FCC120C7E7F0F120C7E20B366
|
||||||
|
:1002BE002D120C7120B32730B3FD120CA9E4F511E9
|
||||||
|
:1002CE007FCA120C7E7F4F120C8A7F46120C8A7FD9
|
||||||
|
:1002DE0046120C8A7FCC120C7E7F0F120C7E20B140
|
||||||
|
:1002EE009D120C7120B19730B1FD120CA97F0C122A
|
||||||
|
:1002FE000C7EE4FD7F8E120A89AD0B7FC0120A8937
|
||||||
|
:10030E00AD0C7FC2120A89AD117FC4120A897D809D
|
||||||
|
:05031E007F8E020A8938
|
||||||
|
:10093400E517C4540F75F00AA4FFE517540F2FFFF1
|
||||||
|
:10094400E516C4540F75F00AA4FEE516540F2EFEE6
|
||||||
|
:10095400E515C4540F75F00AA4FDE515540F2DFDDB
|
||||||
|
:10096400E5106011ED700E0513E513D394324005C4
|
||||||
|
:10097400E4F513F510E511601AEFB50B16EEB50C9E
|
||||||
|
:1009840012EDC39400400CED94035007E51070037E
|
||||||
|
:10099400751001BD3B03E4F51030B10320B005E44C
|
||||||
|
:0409A400F510D2A0D8
|
||||||
|
:0109A800222C
|
||||||
|
:10000300E5106012C2A07F327E00120B6DD2A07F7A
|
||||||
|
:07001300327E00120B6D228A
|
||||||
|
:0B0C960053890F438910D2ABD2AF226C
|
||||||
|
:03001B00020B4194
|
||||||
|
:100B4100C0E0C0D0758DD8758BF03000140514E568
|
||||||
|
:100B510014C39464400B7514000509E5097002057E
|
||||||
|
:060B610008D0D0D0E03204
|
||||||
|
:1009A900E4F51EFB7A00791C120C0B503FE51C3054
|
||||||
|
:1009B900E714E51DF4FFE51CF4FEEF2401F51DE441
|
||||||
|
:1009C9003EF51C751E01AE1CAF1D7C007D0A12068A
|
||||||
|
:1009D900487D101206AF8E0D8F0EE51E600BC3E425
|
||||||
|
:0C09E900950EF50EE4950DF50D120CA115
|
||||||
|
:0109F50022DF
|
||||||
|
:060B6700C2A07F287E0001
|
||||||
|
:100B6D00E4FDFCC3ED9FEC9E5015E4FBFA0BBB00BE
|
||||||
|
:0F0B7D00010AEB64704A70F50DBD00010C80E4B5
|
||||||
|
:010B8C002246
|
||||||
|
:060CA900120B67D2A0222D
|
||||||
|
:100C3E00120B67D2A07F1E120B6DC2A07F28120B63
|
||||||
|
:040C4E006DD2A022A1
|
||||||
|
:0C0C71007F017E267D82DDFEDEFADFF6CC
|
||||||
|
:010C7D002254
|
||||||
|
:100A4000C2A58B807F017E00120A70D2A77F017E33
|
||||||
|
:100A500000120A70C2A77F017E00120A70EBC45414
|
||||||
|
:100A6000F0F5807F017E00120A70D2A77F017E0020
|
||||||
|
:100A7000D3EF9400EE9400400F7DC77C01DCFEDDD7
|
||||||
|
:080A8000FAEF1F70EB1E80E885
|
||||||
|
:010A8800224B
|
||||||
|
:0C0C7E00AB07C2A7C2A6120A40C2A72200
|
||||||
|
:0C0C8A00AB07C2A7D2A6120A40C2A722E4
|
||||||
|
:100BED007F32120C7E7F28120C7E7F0C120C7E7FC2
|
||||||
|
:0E0BFD0006120C7E7F01120C7E7F80020C7EA1
|
||||||
|
:0E0C630081838587898B8D80828486888A8C28
|
||||||
|
:090AE300071500001201010213C5
|
||||||
|
:100A8900C29200C29000D29200E4FEEF139291EF5D
|
||||||
|
:100A9900C313FFD29000C290000EBE08EEE4FEED33
|
||||||
|
:100AA900139291EDC313FDD29000C290000EBE08BF
|
||||||
|
:040AB900EEC29200F7
|
||||||
|
:010ABD002216
|
||||||
|
:1009F600C29200C29000D29200E4FDEF139291EFF2
|
||||||
|
:100A0600C313FFD29000C290000DBD08EE00E4FDB6
|
||||||
|
:100A1600A291E433FFC43333335480FCEEC3134C4A
|
||||||
|
:100A2600FED29000C290000DBD08E5C29200D290A1
|
||||||
|
:090A360000C29100D29100AF064C
|
||||||
|
:010A3F002294
|
||||||
|
:100AED007F811209F6EF30E723E4FD7F8E120A892C
|
||||||
|
:100AFD00E4FCEC900C6A93FF74152CF8E6FD120AD9
|
||||||
|
:0C0B0D00890CBC07ED7D807F8E120A89E8
|
||||||
|
:010B190022B9
|
||||||
|
:100C2800E4FBEB900C6393FF1209F674152BF8A6FE
|
||||||
|
:050C3800070BBB07EDF6
|
||||||
|
:010C3D002294
|
||||||
|
:100C5200C2B7E4FF0FBFC8FCD2B7E4FF0FBF64FC0A
|
||||||
|
:010C6200226F
|
||||||
|
:050B1A00120C527FCC1B
|
||||||
|
:100B1F00E4FEC2B700EF30E004D2B78002C2B7E400
|
||||||
|
:100B2F00FD0DBD1EFCD2B70000EFC313FF0EBE08B4
|
||||||
|
:010B3F00E1D4
|
||||||
|
:010B40002292
|
||||||
|
:100BCE00E4FFFEEFC313FFC2B700D2B7000030B789
|
||||||
|
:0E0BDE0003430780E4FD0DBD14FC0EBE08E5C8
|
||||||
|
:010BEC0022E6
|
||||||
|
:080CA100120B1A7F44020B1F25
|
||||||
|
:100B8D00AC07120B1A7F4E120B1FE4FF120B1FE462
|
||||||
|
:100B9D00FF120B1FAF04120B1F120B1A7F48020B13
|
||||||
|
:010BAD001F28
|
||||||
|
:100C0B00120B1A7FBE120B1F120BCEAC07120BCEA0
|
||||||
|
:0C0C1B00EFFFAD04EDCF8FF01206E5D323
|
||||||
|
:010C270022AA
|
||||||
|
:1007A200020704E493A3F8E493A34003F68001F262
|
||||||
|
:1007B20008DFF48029E493A3F85407240CC8C33358
|
||||||
|
:1007C200C4540F4420C8834004F456800146F6DF27
|
||||||
|
:1007D200E4800B0102040810204080900ABEE47EEF
|
||||||
|
:1007E200019360BCA3FF543F30E509541FFEE4931C
|
||||||
|
:1007F200A360010ECF54C025E060A840B8E493A3E3
|
||||||
|
:10080200FAE493A3F8E493A3C8C582C8CAC583CA0D
|
||||||
|
:10081200F0A3C8C582C8CAC583CADFE9DEE780BEC5
|
||||||
|
:010AEC000009
|
||||||
|
:10064800EF8DF0A4A8F0CF8CF0A428CE8DF0A42EC6
|
||||||
|
:02065800FE2280
|
||||||
|
:10065A00BC000BBE0029EF8DF084FFADF022E4CC84
|
||||||
|
:10066A00F875F008EF2FFFEE33FEEC33FCEE9DEC4D
|
||||||
|
:10067A00984005FCEE9DFE0FD5F0E9E4CEFD22ED93
|
||||||
|
:10068A00F8F5F0EE8420D21CFEADF075F008EF2FDD
|
||||||
|
:10069A00FFED33FD4007985006D5F0F222C398FDCE
|
||||||
|
:0506AA000FD5F0EA226B
|
||||||
|
:1006AF00C2D5EC30E709B2D5E4C39DFDE49CFCEE66
|
||||||
|
:1006BF0030E715B2D5E4C39FFFE49EFE12065AC37E
|
||||||
|
:1006CF00E49DFDE49CFC800312065A30D507C3E479
|
||||||
|
:0606DF009FFFE49EFE22D5
|
||||||
|
:1006E500BB010A89828A83F0E5F0A3F0225006F760
|
||||||
|
:0F06F50009A7F01922BBFE06F3E5F009F319225D
|
||||||
|
:00000001FF
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,380 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
|
||||||
|
|
||||||
|
<SchemaVersion>1.0</SchemaVersion>
|
||||||
|
|
||||||
|
<Header>### uVision Project, (C) Keil Software</Header>
|
||||||
|
|
||||||
|
<Targets>
|
||||||
|
<Target>
|
||||||
|
<TargetName>Target 1</TargetName>
|
||||||
|
<ToolsetNumber>0x0</ToolsetNumber>
|
||||||
|
<ToolsetName>MCS-51</ToolsetName>
|
||||||
|
<TargetOption>
|
||||||
|
<TargetCommonOption>
|
||||||
|
<Device>AT89C51</Device>
|
||||||
|
<Vendor>Atmel</Vendor>
|
||||||
|
<Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
|
||||||
|
<FlashUtilSpec></FlashUtilSpec>
|
||||||
|
<StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
|
||||||
|
<FlashDriverDll></FlashDriverDll>
|
||||||
|
<DeviceId>2976</DeviceId>
|
||||||
|
<RegisterFile>REGX51.H</RegisterFile>
|
||||||
|
<MemoryEnv></MemoryEnv>
|
||||||
|
<Cmp></Cmp>
|
||||||
|
<Asm></Asm>
|
||||||
|
<Linker></Linker>
|
||||||
|
<OHString></OHString>
|
||||||
|
<InfinionOptionDll></InfinionOptionDll>
|
||||||
|
<SLE66CMisc></SLE66CMisc>
|
||||||
|
<SLE66AMisc></SLE66AMisc>
|
||||||
|
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||||
|
<UseEnv>0</UseEnv>
|
||||||
|
<BinPath></BinPath>
|
||||||
|
<IncludePath></IncludePath>
|
||||||
|
<LibPath></LibPath>
|
||||||
|
<RegisterFilePath>Atmel\</RegisterFilePath>
|
||||||
|
<DBRegisterFilePath>Atmel\</DBRegisterFilePath>
|
||||||
|
<TargetStatus>
|
||||||
|
<Error>0</Error>
|
||||||
|
<ExitCodeStop>0</ExitCodeStop>
|
||||||
|
<ButtonStop>0</ButtonStop>
|
||||||
|
<NotGenerated>0</NotGenerated>
|
||||||
|
<InvalidFlash>1</InvalidFlash>
|
||||||
|
</TargetStatus>
|
||||||
|
<OutputDirectory>.\</OutputDirectory>
|
||||||
|
<OutputName>pro</OutputName>
|
||||||
|
<CreateExecutable>1</CreateExecutable>
|
||||||
|
<CreateLib>0</CreateLib>
|
||||||
|
<CreateHexFile>1</CreateHexFile>
|
||||||
|
<DebugInformation>1</DebugInformation>
|
||||||
|
<BrowseInformation>1</BrowseInformation>
|
||||||
|
<ListingPath>.\</ListingPath>
|
||||||
|
<HexFormatSelection>0</HexFormatSelection>
|
||||||
|
<Merge32K>0</Merge32K>
|
||||||
|
<CreateBatchFile>0</CreateBatchFile>
|
||||||
|
<BeforeCompile>
|
||||||
|
<RunUserProg1>0</RunUserProg1>
|
||||||
|
<RunUserProg2>0</RunUserProg2>
|
||||||
|
<UserProg1Name></UserProg1Name>
|
||||||
|
<UserProg2Name></UserProg2Name>
|
||||||
|
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||||
|
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||||
|
</BeforeCompile>
|
||||||
|
<BeforeMake>
|
||||||
|
<RunUserProg1>0</RunUserProg1>
|
||||||
|
<RunUserProg2>0</RunUserProg2>
|
||||||
|
<UserProg1Name></UserProg1Name>
|
||||||
|
<UserProg2Name></UserProg2Name>
|
||||||
|
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||||
|
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||||
|
</BeforeMake>
|
||||||
|
<AfterMake>
|
||||||
|
<RunUserProg1>0</RunUserProg1>
|
||||||
|
<RunUserProg2>0</RunUserProg2>
|
||||||
|
<UserProg1Name></UserProg1Name>
|
||||||
|
<UserProg2Name></UserProg2Name>
|
||||||
|
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||||
|
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||||
|
</AfterMake>
|
||||||
|
<SelectedForBatchBuild>0</SelectedForBatchBuild>
|
||||||
|
<SVCSIdString></SVCSIdString>
|
||||||
|
</TargetCommonOption>
|
||||||
|
<CommonProperty>
|
||||||
|
<UseCPPCompiler>0</UseCPPCompiler>
|
||||||
|
<RVCTCodeConst>0</RVCTCodeConst>
|
||||||
|
<RVCTZI>0</RVCTZI>
|
||||||
|
<RVCTOtherData>0</RVCTOtherData>
|
||||||
|
<ModuleSelection>0</ModuleSelection>
|
||||||
|
<IncludeInBuild>1</IncludeInBuild>
|
||||||
|
<AlwaysBuild>0</AlwaysBuild>
|
||||||
|
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||||
|
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||||
|
<PublicsOnly>0</PublicsOnly>
|
||||||
|
<StopOnExitCode>3</StopOnExitCode>
|
||||||
|
<CustomArgument></CustomArgument>
|
||||||
|
<IncludeLibraryModules></IncludeLibraryModules>
|
||||||
|
<BankNo>65535</BankNo>
|
||||||
|
</CommonProperty>
|
||||||
|
<DllOption>
|
||||||
|
<SimDllName>S8051.DLL</SimDllName>
|
||||||
|
<SimDllArguments></SimDllArguments>
|
||||||
|
<SimDlgDll>DP51.DLL</SimDlgDll>
|
||||||
|
<SimDlgDllArguments>-p51</SimDlgDllArguments>
|
||||||
|
<TargetDllName>S8051.DLL</TargetDllName>
|
||||||
|
<TargetDllArguments></TargetDllArguments>
|
||||||
|
<TargetDlgDll>TP51.DLL</TargetDlgDll>
|
||||||
|
<TargetDlgDllArguments>-p51</TargetDlgDllArguments>
|
||||||
|
</DllOption>
|
||||||
|
<DebugOption>
|
||||||
|
<OPTHX>
|
||||||
|
<HexSelection>0</HexSelection>
|
||||||
|
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||||
|
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||||
|
<HexOffset>0</HexOffset>
|
||||||
|
<Oh166RecLen>16</Oh166RecLen>
|
||||||
|
</OPTHX>
|
||||||
|
<Simulator>
|
||||||
|
<UseSimulator>1</UseSimulator>
|
||||||
|
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||||
|
<RunToMain>1</RunToMain>
|
||||||
|
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||||
|
<RestoreWatchpoints>1</RestoreWatchpoints>
|
||||||
|
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||||
|
<RestoreFunctions>1</RestoreFunctions>
|
||||||
|
<RestoreToolbox>1</RestoreToolbox>
|
||||||
|
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
|
||||||
|
</Simulator>
|
||||||
|
<Target>
|
||||||
|
<UseTarget>0</UseTarget>
|
||||||
|
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||||
|
<RunToMain>0</RunToMain>
|
||||||
|
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||||
|
<RestoreWatchpoints>1</RestoreWatchpoints>
|
||||||
|
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||||
|
<RestoreFunctions>0</RestoreFunctions>
|
||||||
|
<RestoreToolbox>1</RestoreToolbox>
|
||||||
|
</Target>
|
||||||
|
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||||
|
<TargetSelection>-1</TargetSelection>
|
||||||
|
<SimDlls>
|
||||||
|
<CpuDll></CpuDll>
|
||||||
|
<CpuDllArguments></CpuDllArguments>
|
||||||
|
<PeripheralDll></PeripheralDll>
|
||||||
|
<PeripheralDllArguments></PeripheralDllArguments>
|
||||||
|
<InitializationFile></InitializationFile>
|
||||||
|
</SimDlls>
|
||||||
|
<TargetDlls>
|
||||||
|
<CpuDll></CpuDll>
|
||||||
|
<CpuDllArguments></CpuDllArguments>
|
||||||
|
<PeripheralDll></PeripheralDll>
|
||||||
|
<PeripheralDllArguments></PeripheralDllArguments>
|
||||||
|
<InitializationFile></InitializationFile>
|
||||||
|
<Driver></Driver>
|
||||||
|
</TargetDlls>
|
||||||
|
</DebugOption>
|
||||||
|
<Utilities>
|
||||||
|
<Flash1>
|
||||||
|
<UseTargetDll>0</UseTargetDll>
|
||||||
|
<UseExternalTool>0</UseExternalTool>
|
||||||
|
<RunIndependent>0</RunIndependent>
|
||||||
|
<UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
|
||||||
|
<Capability>0</Capability>
|
||||||
|
<DriverSelection>-1</DriverSelection>
|
||||||
|
</Flash1>
|
||||||
|
<Flash2></Flash2>
|
||||||
|
<Flash3></Flash3>
|
||||||
|
<Flash4></Flash4>
|
||||||
|
</Utilities>
|
||||||
|
<Target51>
|
||||||
|
<Target51Misc>
|
||||||
|
<MemoryModel>0</MemoryModel>
|
||||||
|
<RTOS>0</RTOS>
|
||||||
|
<RomSize>2</RomSize>
|
||||||
|
<DataHold>0</DataHold>
|
||||||
|
<XDataHold>0</XDataHold>
|
||||||
|
<UseOnchipRom>0</UseOnchipRom>
|
||||||
|
<UseOnchipArithmetic>0</UseOnchipArithmetic>
|
||||||
|
<UseMultipleDPTR>0</UseMultipleDPTR>
|
||||||
|
<UseOnchipXram>0</UseOnchipXram>
|
||||||
|
<HadIRAM>1</HadIRAM>
|
||||||
|
<HadXRAM>0</HadXRAM>
|
||||||
|
<HadIROM>1</HadIROM>
|
||||||
|
<Moda2>0</Moda2>
|
||||||
|
<Moddp2>0</Moddp2>
|
||||||
|
<Modp2>0</Modp2>
|
||||||
|
<Mod517dp>0</Mod517dp>
|
||||||
|
<Mod517au>0</Mod517au>
|
||||||
|
<Mode2>0</Mode2>
|
||||||
|
<useCB>0</useCB>
|
||||||
|
<useXB>0</useXB>
|
||||||
|
<useL251>0</useL251>
|
||||||
|
<useA251>0</useA251>
|
||||||
|
<Mx51>0</Mx51>
|
||||||
|
<ModC812>0</ModC812>
|
||||||
|
<ModCont>0</ModCont>
|
||||||
|
<Lp51>0</Lp51>
|
||||||
|
<useXBS>0</useXBS>
|
||||||
|
<ModDA>0</ModDA>
|
||||||
|
<ModAB2>0</ModAB2>
|
||||||
|
<Mx51P>0</Mx51P>
|
||||||
|
<hadXRAM2>0</hadXRAM2>
|
||||||
|
<uocXram2>0</uocXram2>
|
||||||
|
<ModC2>0</ModC2>
|
||||||
|
<ModH2>0</ModH2>
|
||||||
|
<Mdu_R515>0</Mdu_R515>
|
||||||
|
<Mdu_F120>0</Mdu_F120>
|
||||||
|
<Psoc>0</Psoc>
|
||||||
|
<hadIROM2>0</hadIROM2>
|
||||||
|
<ModSmx2>0</ModSmx2>
|
||||||
|
<cBanks>0</cBanks>
|
||||||
|
<xBanks>0</xBanks>
|
||||||
|
<OnChipMemories>
|
||||||
|
<RCB>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0xffff</Size>
|
||||||
|
</RCB>
|
||||||
|
<RXB>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</RXB>
|
||||||
|
<Ocm1>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocm1>
|
||||||
|
<Ocm2>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocm2>
|
||||||
|
<Ocm3>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocm3>
|
||||||
|
<Ocr1>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocr1>
|
||||||
|
<Ocr2>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocr2>
|
||||||
|
<Ocr3>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</Ocr3>
|
||||||
|
<IRO>
|
||||||
|
<Type>1</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x1000</Size>
|
||||||
|
</IRO>
|
||||||
|
<IRA>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x80</Size>
|
||||||
|
</IRA>
|
||||||
|
<XRA>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</XRA>
|
||||||
|
<XRA512>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</XRA512>
|
||||||
|
<IROM512>
|
||||||
|
<Type>0</Type>
|
||||||
|
<StartAddress>0x0</StartAddress>
|
||||||
|
<Size>0x0</Size>
|
||||||
|
</IROM512>
|
||||||
|
</OnChipMemories>
|
||||||
|
</Target51Misc>
|
||||||
|
<C51>
|
||||||
|
<RegisterColoring>0</RegisterColoring>
|
||||||
|
<VariablesInOrder>0</VariablesInOrder>
|
||||||
|
<IntegerPromotion>1</IntegerPromotion>
|
||||||
|
<uAregs>0</uAregs>
|
||||||
|
<UseInterruptVector>1</UseInterruptVector>
|
||||||
|
<Fuzzy>3</Fuzzy>
|
||||||
|
<Optimize>8</Optimize>
|
||||||
|
<WarningLevel>2</WarningLevel>
|
||||||
|
<SizeSpeed>1</SizeSpeed>
|
||||||
|
<ObjectExtend>1</ObjectExtend>
|
||||||
|
<ACallAJmp>0</ACallAJmp>
|
||||||
|
<InterruptVectorAddress>0</InterruptVectorAddress>
|
||||||
|
<VariousControls>
|
||||||
|
<MiscControls></MiscControls>
|
||||||
|
<Define></Define>
|
||||||
|
<Undefine></Undefine>
|
||||||
|
<IncludePath></IncludePath>
|
||||||
|
</VariousControls>
|
||||||
|
</C51>
|
||||||
|
<Ax51>
|
||||||
|
<UseMpl>0</UseMpl>
|
||||||
|
<UseStandard>1</UseStandard>
|
||||||
|
<UseCase>0</UseCase>
|
||||||
|
<UseMod51>0</UseMod51>
|
||||||
|
<VariousControls>
|
||||||
|
<MiscControls></MiscControls>
|
||||||
|
<Define></Define>
|
||||||
|
<Undefine></Undefine>
|
||||||
|
<IncludePath></IncludePath>
|
||||||
|
</VariousControls>
|
||||||
|
</Ax51>
|
||||||
|
<Lx51>
|
||||||
|
<useFile>0</useFile>
|
||||||
|
<linkonly>0</linkonly>
|
||||||
|
<UseMemoryFromTarget>1</UseMemoryFromTarget>
|
||||||
|
<CaseSensitiveSymbols>0</CaseSensitiveSymbols>
|
||||||
|
<WarningLevel>2</WarningLevel>
|
||||||
|
<DataOverlaying>1</DataOverlaying>
|
||||||
|
<OverlayString></OverlayString>
|
||||||
|
<MiscControls></MiscControls>
|
||||||
|
<DisableWarningNumbers></DisableWarningNumbers>
|
||||||
|
<LinkerCmdFile></LinkerCmdFile>
|
||||||
|
<Assign></Assign>
|
||||||
|
<ReserveString></ReserveString>
|
||||||
|
<CClasses></CClasses>
|
||||||
|
<UserClasses></UserClasses>
|
||||||
|
<CSection></CSection>
|
||||||
|
<UserSection></UserSection>
|
||||||
|
<CodeBaseAddress></CodeBaseAddress>
|
||||||
|
<XDataBaseAddress></XDataBaseAddress>
|
||||||
|
<PDataBaseAddress></PDataBaseAddress>
|
||||||
|
<BitBaseAddress></BitBaseAddress>
|
||||||
|
<DataBaseAddress></DataBaseAddress>
|
||||||
|
<IDataBaseAddress></IDataBaseAddress>
|
||||||
|
<Precede></Precede>
|
||||||
|
<Stack></Stack>
|
||||||
|
<CodeSegmentName></CodeSegmentName>
|
||||||
|
<XDataSegmentName></XDataSegmentName>
|
||||||
|
<BitSegmentName></BitSegmentName>
|
||||||
|
<DataSegmentName></DataSegmentName>
|
||||||
|
<IDataSegmentName></IDataSegmentName>
|
||||||
|
</Lx51>
|
||||||
|
</Target51>
|
||||||
|
</TargetOption>
|
||||||
|
<Groups>
|
||||||
|
<Group>
|
||||||
|
<GroupName>Source Group 1</GroupName>
|
||||||
|
<Files>
|
||||||
|
<File>
|
||||||
|
<FileName>STARTUP.A51</FileName>
|
||||||
|
<FileType>2</FileType>
|
||||||
|
<FilePath>.\STARTUP.A51</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>main.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>.\main.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>lcd.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>.\lcd.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>ds1302.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>.\ds1302.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>ds18b20.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>.\ds18b20.c</FilePath>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
</Group>
|
||||||
|
</Groups>
|
||||||
|
</Target>
|
||||||
|
</Targets>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user