电子时钟数字电子钟单片机课程设计_第1页
电子时钟数字电子钟单片机课程设计_第2页
电子时钟数字电子钟单片机课程设计_第3页
电子时钟数字电子钟单片机课程设计_第4页
电子时钟数字电子钟单片机课程设计_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

In order to ensure normal teaching order, protecting students healthy growth, ensuring that national (property) is not lost, to prevent or minimize the occurrence of safety accidents, follow the prevent, rescue each other, ensure safety and reduce losses principle, according to the local conditions, make the management system. 1, the principal is the responsibility of school safety, school security under the leadership of President security work leading group. The head teacher to the leadership team is responsible for, implementation of the accountability system. 2, school monthly student knowledge about safety education, education should be diversified in the form every safety education for students of classes per week should be targeted. To carry on emergency issues dealing with education in General, self-help and mutual rescue knowledge. Emergency calls (such as 110, 119, 122, 120, and so on) use common sense in education. 3, the establishment of major accident reporting system. School students report major accident within an hour of education; student run and disappearances to report; report of the accident to a written report in triplicate, a correctional centre, a police station, a township peoples Government shall not conceal the accident. 4 week, teachers are on duty system, establish and improve the leadership values; strengthen the education, management of teaching activities in schools to ensure normal teaching order; responsible for school safety leadership always maintained close contact and district police stations, canvassing support from the police station on school safety and help. 5, strengthening teachers moral education, establish a dedicated love, improving education quality, observe the students psychological changes at any time and take preventive measures, no corporal punishment and covert corporal punishment on students, student out of the classroom, schools may not be. 6, units or departments use student Street propaganda or participate in the celebrations, as well as participating in other social work, without approval of the Correctional Centre, school principals consent, without organization. Without the approval of relevant departments, may organize students to participate in fire fighting, disaster relief and so on. 7, schools should educate students to obey the school rules and regulations, on time, on time home to prevent accidents. 8, school to school inspections on a regular basis, found hidden in time, and in severe cases, it is hard to eliminate immediately closed, and reported to the local peoples Government, education, and rule of law section. 9, the school should always check the internal walls, retaining walls, ponds, railings, handrails, doors, Windows, staircases and a variety of sports, extracurricular activities, facilities such as fire safety, infrastructure security, unsafe facility to immediately repair and demolition to ensure that teachers and students work, learn, live venues and facilities are safe and reliable. Song Lin Xiang Liu Jia ping elementary school March 2016 song Lin Xiang Liu Jia ping primary school fire safety systems to enhance fire safety, protection of public property and the life and property safety of teachers and students, school fire safety into day-to-day management, is developing the following fire safety system. 1, strengthen fire safety education of the whole school. According to the requirements of the Fire Services Act, so that everyone has of keeping fire control safety, protecting fire control facilities, fire prevention, reports of fire附录一:软件设计中断入口程序ORG 0000H;程序执行开始地址LJMP START;跳到标号START执行ORG 0003H;外中断0中断程序入口RETI;外中断0中断返回ORG 000BH;定时器T0中断程序入口LJMP INTT0;跳至INTTO执行ORG 0013H;外中断1中断程序入口RETI ;外中断1中断返回ORG 001BH;定时器T1中断程序入口LJMP INTT1;跳至INTT1执行ORG 0023H;串行中断程序入口地址RETI;串行中断程序返回主 程 序 START: MOV R0,#70H ;清70H-7AH共11个内存单元 MOV R7,#0BH clr P3.7; CLEARDISP: MOV R0,#00H ; INC R0 ; DJNZ R7,CLEARDISP ; MOV 20H,#00H ;清20H(标志用) MOV 7AH,#0AH ;放入熄灭符数据 MOV TMOD,#11H ;设T0、T1为16位定时器 MOV TL0,#0B0H ;50MS定时初值(T0计时用) MOV TH0,#3CH ;50MS定时初值 MOV TL1,#0B0H ;50MS定时初值(T1闪烁定时用) MOV TH1,#3CH ;50MS定时初值 SETB EA ;总中断开放 SETB ET0 ;允许T0中断 SETB TR0 ;开启T0定时器 MOV R4,#14H ;1秒定时用初值(50MS20) START1: LCALL DISPLAY ;调用显示子程序 JNB P3.7,SETMM1 ;P3.7口为0时转时间调整程序 SJMP START1 ;P3.7口为1时跳回START1 SETMM1: LJMP SETMM ;转到时间调整程序SETMM1秒计时程序;T0中断服务程序INTT0: PUSH ACC ;累加器入栈保护 PUSH PSW ;状态字入栈保护 CLR ET0 ;关T0中断允许 CLR TR0 ;关闭定时器T0 MOV A,#0B7H ;中断响应时间同步修正 ADD A,TL0 ;低8位初值修正 MOV TL0,A ;重装初值(低8位修正值) MOV A,#3CH ;高8位初值修正 ADDC A,TH0 ; MOV TH0,A ;重装初值(高8位修正值) SETB TR0 ;开启定时器T0 DJNZ R4, OUTT0 ;20次中断未到中断退出 ADDSS: MOV R4,#14H ;20次中断到(1秒)重赋初值 MOV R0,#71H ;指向秒计时单元(71H-72H) ACALL ADD1 ;调用加1程序(加1秒操作) MOV A,R3 ;秒数据放入A(R3为2位十进制数组合) CLR C ;清进位标志 CJNE A,#60H,ADDMM ; ADDMM: JC OUTT0 ;小于60秒时中断退出 ACALL CLR0 ;大于或等于60秒时对秒计时单元清0 MOV R0,#77H ;指向分计时单元(76H-77H) ACALL ADD1 ;分计时单元加1分钟 MOV A,R3 ;分数据放入A CLR C ;清进位标志 CJNE A,#60H,ADDHH ; ADDHH: JC OUTT0 ;小于60分时中断退出 ACALL CLR0 ;大于或等于60分时分计时单元清0 MOV R0,#79H ;指向小时计时单(78H-79H) ACALL ADD1 ;小时计时单元加1小时 MOV A,R3 ;时数据放入A CLR C ;清进位标志 CJNE A,#24H,HOUR ; HOUR: JC OUTT0 ;小于12小时中断退出 ACALL CLR0 ;大于或等于12小时小时计时单元清0 OUTT0: MOV 72H,76H ;中断退出时将分、时计时单元数据移 MOV 73H,77H ;入对应显示单元 MOV 74H,78H ; MOV 75H,79H ; POP PSW ;恢复状态字(出栈) POP ACC ;恢复累加器 SETB ET0 ;开放T0中断 RETI ;中断返回闪动调时程序 ;T1中断服务程序,用作时间调整时调整单元闪烁指示INTT1: PUSH ACC ;中断现场保护 PUSH PSW ; MOV TL1, #0B0H ;装定时器T1定时初值 MOV TH1, #3CH ; DJNZ R2,INTT1OUT ;0.3秒未到退出中断(50MS中断6次) MOV R2,#06H ;重装0.3秒定时用初值 CPL 02H ;0.3秒定时到对闪烁标志取反 JB 02H,FLASH1 ;02H位为1时显示单元熄灭 MOV 72H,76H ;02H位为0时正常显示 MOV 73H,77H ; MOV 74H,78H ; MOV 75H,79H ;INTT1OUT: POP PSW ;恢复现场 POP ACC ; RETI ;中断退出FLASH1: JB 01H,FLASH2 ;01H位为1时,转小时熄灭控制 MOV 72H,7AH ;01H位为0时,熄灭符数据放入分 MOV 73H,7AH ;显示单元(72H-73H),将不显示分数据 MOV 74H,78H ; MOV 75H,79H ; AJMP INTT1OUT ;转中断退出FLASH2: MOV 72H,76H ;01H位为1时,熄灭符数据放入小时 MOV 73H,77H ;显示单元(74H-75H),小时数据将不显示 MOV 74H,7AH ; MOV 75H,7AH ; AJMP INTT1OUT ;转中断退出加1子 程 序 ;ADD1: MOV A,R0 ;取当前计时单元数据到A DEC R0 ;指向前一地址 SWAP A ;A中数据高四位与低四位交换 ORL A,R0 ;前一地址中数据放入A中低四位 ADD A,#01H ;A加1操作 DA A ;十进制调整 MOV R3,A ;移入R3寄存器 ANL A,#0FH ;高四位变0 MOV R0,A ;放回前一地址单元 MOV A,R3 ;取回R3中暂存数据 INC R0 ;指向当前地址单元 SWAP A ;A中数据高四位与低四位交换 ANL A,#0FH ;高四位变0 MOV R0,A ;数据放入当削地址单元中 RET ;子程序返回 清零程序 ;对计时单元复零用CLR0: CLR A ;清累加器 MOV R0,A ;清当前地址单元 DEC R0 ;指向前一地址 MOV R0,A ;前一地址单元清0 RET ;子程序返回时钟调整程序;当调时按键按下时进入此程序 SETMM: cLR ET0 ;关定时器T0中断 CLR TR0 ;关闭定时器T0 LCALL DL1S ;调用1秒延时程序 JB P3.7,CLOSEDIS ;键按下时间小于1秒,关闭显示(省电) MOV R2,#06H ;进入调时状态,赋闪烁定时初值 SETB ET1 ;允许T1中断 SETB TR1 ;开启定时器T1 SET2: JNB P3.7,SET1 ;P3.7口为0(键未释放),等待 SETB 00H ;键释放,分调整闪烁标志置1 SET4: JB P3.7,SET3 ;等待键按下 LCALL DL05S ;有键按下,延时0.5秒 JNB P3.7,SETHH ;按下时间大于0.5秒转调小时状态 MOV R0,#77H ;按下时间小于0.5秒加1分钟操作 LCALL ADD1 ;调用加1子程序 MOV A,R3 ;取调整单元数据 CLR C ;清进位标志 CJNE A,#60H,HHH ;调整单元数据与60比较 HHH: JC SET4 ;调整单元数据小于60转SET4循环 LCALL CLR0 ;调整单元数据大于或等于60时清0 CLR C ;清进位标志 AJMP SET4 ;跳转到SET4循环 CLOSEDIS: SETB ET0 ;省电(LED不显示)状态。开T0中断 SETB TR0 ;开启T0定时器(开时钟) CLOSE: JB P3.7,CLOSE ;无按键按下,等待。 LCALL DISPLAY ;有键按下,调显示子程序延时削抖 JB P3.7,CLOSE ;是干扰返回CLOSE等待 WAITH: JNB P3.7,WAITH ;等待键释放 LJMP START1 ;返回主程序(LED数据显示亮) SETHH: CLR 00H ;分闪烁标志清除(进入调小时状态) SETHH1: JNB P3.7,SET5 ;等待键释放 SETB 01H ;小时调整标志置1 SET6: JB P3.7,SET7 ;等待按键按下 LCALL DL05S ;有键按下延时0.5秒 JNB P3.7,SETOUT ;按下时间大于0.5秒退出时间调整 MOV R0,#79H ;按下时间小于0.5秒加1小时操作 LCALL ADD1 ;调加1子程序 MOV A,R3 ; CLR C ; CJNE A,#12H,HOUU ;计时单元数据与12比较 HOUU: JC SET6 ;小于12转SET6循环 LCALL CLR0 ;大于或等于24时清0操作 AJMP SET6 ;跳转到SET6循环 SETOUT: JNB P3.7,SETOUT1 ;调时退出程序。等待键释放 LCALL DISPLAY ;延时削抖 JNB P3.7,SETOUT ;是抖动,返回SETOUT再等待 CLR 01H ;清调小时标志 CLR 00H ;清调分标志 CLR 02H ;清闪烁标志 CLR TR1 ;关闭定时器T1 CLR ET1 ;关定时器T1中断 SETB TR0 ;开启定时器T0 SETB ET0 ;开定时器T0中断(计时开始) LJMP START1 ;跳回主程序 SET1: LCALL DISPLAY ;键释放等待时调用显示程序(调分) AJMP SET2 ;防止键按下时无时钟显示 SET3: LCALL DISPLAY ;等待调分按键时时钟显示用 AJMP SET4 SET5: LCALL DISPLAY ;键释放等待时调用显示程序(调小时) AJMP SETHH1 ;防止键按下时无时钟显示 SET7: LCALL DISPLAY ;等待调小时按键时时钟显示用 AJMP SET6 SETOUT1: LCALL DISPLAY ;退出时钟调整时键释放等待 AJMP SETOUT ;防止键按下时无时钟显示; 显示程序 ; 显示数据在70H-75H单元内,用六位LED共阳数码管显示,P0口输出段码数据,P3口作; 扫描控制,每个LED数码管亮1MS时间再逐位循环。 DISPLAY: MOV R1,#70H ;指向显示数据首址 MOV R5,#0FEH ;扫描控制字初值 PLAY: MOV A,R5 ;扫描字放入A MOV P2,A ;从P2口输出 MOV A,R1 ;取显示数据到A MOV DPTR,#TAB ;取段码表地址 MOVC A,A+DPTR ;查显示数据对应段码 MOV P1,A ;段码放入P0口 LCALL DL1MS ;显示1MS INC R1 ;指向下一地址 MOV A,R5 ;扫描控制字放入A JNB ACC.5,ENDOUT ;ACC.5=0时一次显示结束 RL A ;A中数据循环左移 MOV R5,A ;放回R5内 AJMP PLAY ;跳回PLAY循环 ENDOUT: SETB P2.5 ;一次显示结束,P2口复位 MOV P1,#0FFH ;P0口复位 RET ;子程序返回 TAB: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH;1MS延时程序,LED显示程序用 DL1MS: MOV R6,#14H DL1: MOV R7,#19H DL2: DJNZ R7,DL2 DJNZ R6,DL1 RET;20MS延时程序,采用调用显示子程序以改善LED的显示闪烁现象 DS20MS: ACALL DISPLAY ACALL DISPLAY ACALL DISPLAY RET;延时程序,用作按键时间的长短判断 DL1S: LCALL DL05S LCALL DL05S RET DL05S: MOV R3,#20H ;8毫秒*32=0.196秒 DL05S1: LCALL DISPLAY DJNZ R3,DL05S1 RET END ;程序结束整点报时程序:ORG 0000HLJMP STARTORG 000BHINC 20H ;中断服务,中断计数器加1MOV TH0,#0D8HMOV TL0,#0EFH ;形成10毫秒中断RETISTART:SETB P1.3JB P0.3,$ MOV SP,#50HMOV TH0,#0D8HMOV TL0,#0EFHMOV TMOD,#01HMOV IE,#82HMUSIC0:NOPMOV DPTR,#DAT ;表头地址送DPTRMOV 20H,#00H ;中断计数器清0MOV B,#00H ;表序号清0MUSIC1:NOPCLR AMOVC A,A+DPTR ;查表取代码JZ END0 ;是00H,则结束CJNE A,#0FFH,MUSIC5LJMP MUSIC3MUSIC5:NOPMOV R6,AINC DPTRMOV A,BMOVC A,A+DPTR ;取节拍代码送R7MOV R7,ASETB TR0 ;启动计数MUSIC2:NOPCPL P1.3MOV A,R6MOV R3,ALCALL DELMOV A,R7CJNE A,20H,MUSIC2 ;中断计数器(20H)=R7否?;不等,则继续循环MOV 20H,#00H ;等于,则取下一代码INC DPTR; INC BLJMP MUSIC1MUSIC3:NOPCLR TR0 ;休止100毫秒MOV R2,#0DHMUSIC4:NOPMOV R3,#0FFHLCALL DELDJNZ R2,MUSIC4INC DPTRLJMP MUSIC1END0:NOPMOV R2,#64H LJMP START ;报时结束,返回MUSIC6:MOV R3,#00HLCALL DELDJNZ R2,MUSIC6LJMP MUSIC0DEL:NOPDEL3: MOV R4,#02HDEL4: NOPDJNZ R4,DEL4NOPDJNZ R3,DEL3RETNOPDAT:db 26h,20h,20h,20h,20h,20h,26h,10h,20h,10h,20h,80h,26h,20h,30h,20hdb 30h,20h,39h,10h,30h,10h,30h,80h,26h,20h,20h,20h,20h,20h,1ch,20hdb 20h,80h,2bh,20h,26h,20h,20h,20h,2bh,10h,26h,10h,2bh,80h,26h,20hdb 30h,20h,30h,20h,39h,10h,26h,10h,26h,60h,40h,10h,39h,10h,26h,20hdb 30h,20h,30h,20h,39h,10h,26h,10h,26h,80h,26h,20h,2bh,10h,2bh,10hdb 2bh,20h,30h,10h,39h,10h,26h,10h,2bh,10h,2bh,20h,2bh,40h,40h,20hdb 20h,10h,20h,10h,2bh,10h,26h,30h,30h,80h,18h,20h,18h,20h,26h,20hdb 20h,20h,20h,40h,26h,20h,2bh,20h,30h,20h,30h,20h,1ch,20h,20h,20hdb 20h,80h,1ch,20h,1ch,20h,1ch,20h,30h,20h,30h,60h,39h,10h,30h,10hdb 20h,20h,2bh,10h,26h,10h,2bh,10h,26h,10h,26h,10h,2bh,10h,2bh,80hdb 18h,20h,18h,20h,26h,20h,20h,20h,20h,60h,26h,10h,2bh,20h,30h,20hdb 30h,20h,1ch,20h,20h,20h,20h,80h,26h,20h,30h,10h,30h,10h,30h,20hdb 39h,20h,26h,10h,2bh,10h,2bh,20h,2bh,40h,40h,10h,40h,10h,20h,10hdb 20h,10h,2bh,10h,26h,30h,30h,80h,00HEND为进一步加强和改进干部作风,严肃工作纪律,提高工作效能,更好地服务群众、服务企业、服务发展,树立“为民、务实、清廉”的良好形象提振干部队伍精气神,按照县委要求,利用一个月时间Electricity lines, equipment inspections, found hidden in time for rectification, maintenance, and security. 9, do not use an open flame in the classroom, prohibit burning stove, lit candles, mosquito repellent, no smoking, and banning messy wiring. Without using any household appliances is not allowed. 10, live on campus faculty members, must lead by example, and educate families and children ready to fire. 11, household use of gas in schools, to master proper usage, pay attention to the leak-proof, explosion-proof, fireproof, closing valve after use to ensure security. 12, dining room must be qualified, and annual testing of pressure vessels, to regularly check, the canteen workers must be certified, strictly by operation operation, gas tank and stove safety distance of 1.5 meters, to prevent accidents. 13, the adverse consequences caused by ignoring fire safety regulations, will be punished, until investigated for legal responsibility. Song Lin Xiang Liu Jia ping elementary school March 2016 Xiang Liu Jia ping elementary school, pine slopes surrounding safety management system 1 teachers and students, the surrounding area of the school governance covers personal and food hygiene, cultural events and other aspects, integrated governance shall obtain wide support and full cooperation of the community. On the surrounding environment in schools should be closely monitored. 2, school work at the same time, should pay attention to the safety management of school environment, should take the initiative to contact the distric

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论