From 3fa3cebc33345be980c42888b2db4b6ac1fc5793 Mon Sep 17 00:00:00 2001 From: cyp0633 Date: Mon, 22 Aug 2022 17:03:21 +0800 Subject: [PATCH] Problem 5 --- 5/5.uvopt | 197 ++++++++++++++++++++++++++ 5/5.uvproj | 395 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5/main.c | 39 ++++++ 3 files changed, 631 insertions(+) create mode 100644 5/5.uvopt create mode 100644 5/5.uvproj create mode 100644 5/main.c diff --git a/5/5.uvopt b/5/5.uvopt new file mode 100644 index 0000000..a99d45e --- /dev/null +++ b/5/5.uvopt @@ -0,0 +1,197 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + Target 1 + 0x0 + MCS-51 + + 35000000 + + 1 + 1 + 1 + 0 + 0 + + + 0 + 65535 + 0 + 0 + 0 + + + 120 + 65 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + -1 + + + + + + + + + + + + + + + 0 + + + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Source Group 1 + 1 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + .\main.c + main.c + 0 + 0 + + + 1 + 2 + 4 + 0 + 0 + 0 + .\STCBSP_V3.6.LIB + STCBSP_V3.6.LIB + 0 + 0 + + + +
diff --git a/5/5.uvproj b/5/5.uvproj new file mode 100644 index 0000000..11c213d --- /dev/null +++ b/5/5.uvproj @@ -0,0 +1,395 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + Target 1 + 0x0 + MCS-51 + 0 + + + STC15F2K60S2 Series + STC + IRAM(0-0xFF) XRAM(0-0x6FF) IROM(0-0xEFF8) CLOCK(35000000) MODP2 + + "LIB\STARTUP.A51" ("Standard 8051 Startup Code") + + 62472 + STC15F2K60S2.H + + + + + + + + + + + 0 + 0 + + + + STC\ + STC\ + + 0 + 0 + 0 + 0 + 1 + + .\Objects\ + 5 + 1 + 0 + 1 + 1 + 1 + .\Listings\ + 0 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + 65535 + + + S8051.DLL + + DP51.DLL + -pDP8051 + S8051.DLL + + TP51.DLL + -p51 + + + + 0 + 0 + 0 + 0 + 16 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + + 0 + -1 + + + + + + + + + + + + + + + + + + + 0 + 0 + 0 + 0 + 0 + -1 + + 0 + + + + + + + 0 + + + + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0x10000 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0xeff9 + + + 0 + 0x0 + 0x100 + + + 0 + 0x0 + 0x700 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + + + 0 + 0 + 1 + 0 + 1 + 3 + 8 + 2 + 1 + 1 + 0 + 0 + + + + + ../inc + + + + 0 + 1 + 0 + 0 + + + + + + + + + 0 + 0 + 1 + 0 + 2 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source Group 1 + + + main.c + 1 + .\main.c + + + STCBSP_V3.6.LIB + 4 + .\STCBSP_V3.6.LIB + + + + + + + +
diff --git a/5/main.c b/5/main.c new file mode 100644 index 0000000..3b645cd --- /dev/null +++ b/5/main.c @@ -0,0 +1,39 @@ +#include "DS1302.h" +#include "STC15F2K60S2.H" +#include "displayer.h" +#include "sys.h" +#include "universal_decode_table.h" + +code unsigned long SysClock = 11059200; //必须。定义系统工作时钟频率(Hz),用户必须修改成与实际工作频率(下载时选择的)一致 +struct_DS1302_RTC time; +char val; + +void main() +{ + time.year = 0x22; + time.day = 0x22; + time.month = 0x8; + time.hour = 0x15; + time.minute = 0x33; + time.second = 0x22; + DS1302Init(time); + DisplayerInit(); + SetDisplayerArea(0, 0); + LedPrint(0); + val = NVM_Read(0x05); + if (val == 0xf) + { + val = 0; + } + else + { + val = (val + 1) & 0xf; + } + LedPrint(val); + NVM_Write(0x05, val); + MySTC_Init(); + while (1) + { + MySTC_OS(); + } +}