资源描述:
《万年历单片机课程设计报告样本》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。1任务和设计要求首先要学会安装软件,要熟悉会使用。2系统设计系统框图3硬件设计3.1电路原理图
1资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
2资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
3资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。3.2主要单元电路3.3元件清单4软件设计4.1程序流程图
4资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。4.2程序清单TIME_WEEKDATA52HTIME_YEARDATA5DHTIME_MONTHDATA5EHTIME_DATADATA5FHYEARHDATA36HYEARDATA35HMONTHDATA34HDAYDATA33HHOURDATA32HMINUTEDATA31HSECDATA30H
5资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。AAABITP3.0BBBBITP3.1AABITP3.3BBBITP3.4CCBITP3.5BLBITP3.2BZ1BIT21H.0TIMESDATA20HCOMDATAP1ORG0000HLJMPSTARTORG0003HRETIORG000BHLJMPINTT0ORG0013HRETIORG001BHRETIORG0023HRETISTART:
6资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVR0,#30HMOVR7,#9CLEETE:MOV@R0,#00HINCR0DJNZR7,CLEETEMOVTIMES,#00HMOVTMOD,#01HMOVTL0,#0C0HMOVTH0,#63HMOVSEC,#0MOVMINUTE,#0HMOVHOUR,#0HMOVDAY,#01HMOVMONTH,#01HMOVYEAR,#01HMOVYEARH,#20HSETBEASETBET0SETBTR0MOVR4,#19START1:
7资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。CALLDISPJNBAA,SETMM1JMPSTART1SETMM1:CALLSETMMJMPSTART1SETMM:CALLDISPCALLDISPJBAA,SETMM0SETMM2:JNBAA,SETMM3CLRET0CLRTR0MOVSEC,#0MOVTIMES,#01HMOVR0,#MINUTESETMM4:NOPINC22:CALLOFFLCALLINC11
8资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。CALLDISPJBAA,INC22CALLDISPJBAA,INC22INCR0MOVA,TIMESRLAMOVTIMES,AJNBTIMES.5,SETMM4SETMM12:JNBAA,SETMM11SETMM0:SETBTR0SETBET0RETSETMM11:CALLDISPJMPSETMM12SETMM3:CALLDISPJMPSETMM2INC11:
9资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVR3,#40INC111:MOVA,@R0JBBB,INC17ADDA,#1DAACALLINC000INC13:JNBBB,INC14INC17:MOV@R0,ACALLDISPDJNZR3,INC111RETINC14:CALLDISPJMPINC13OFFL:MOV22H,@R0MOVR6,#10OFF1:MOVR7,#10
10资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。OFF2:MOV@R0,#0AAHCALLDISPDJNZR7,OFF2DJNZR6,OFF1MOV@R0,22HRETINC000:JBTIMES.0,INC001JBTIMES.1,INC002JBTIMES.2,INC003JBTIMES.3,INC004JBTIMES.4,INC005JMPINCOUTINC005:CJNEA,#99H,INCOUTMOVA,#00HJMPINCOUTINC004:CJNEA,#13H,INCOUTMOVA,#01HJMPINCOUT
11资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。INC003:CJNEA,#32H,INCOUTMOVA,#01HJMPINCOUTINC002:CJNEA,#24H,INCOUTMOVA,#00HJMPINCOUTINC001:CJNEA,#60H,INCOUTMOVA,#00HINCOUT:RETINTT0:PUSHACCPUSHPSWORLTL0,#0C0HMOVTH0,#63HDJNZR4,CLKE111JMPLOOP11CLKE111:JMPCLKE
12资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。LOOP11:MOVR4,#19HMOVA,SECADDA,#1DAAMOVSEC,ACJNEA,#60H,CLKE99MOVSEC,#0MOVA,MINUTEADDA,#1DAAMOVMINUTE,ACLK0:CJNEA,#60H,CLKEMOVMINUTE,#0MOVA,HOURADDA,#1DAAMOVHOUR,ACJNEA,#24H,CLKEMOVHOUR,#0MOVA,DAY
13资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。ADDA,#1DAAMOVDAY,AMOVA,MONTHINCAMOVCA,@A+PCSJMPCLK1DB31H,28H,31HDB30H,31H,30HDB31H,31H,30HDB00H,00H,00HDB00H,00H,00HDB31H,30H,31HCLK1:CLRCSUBBA,DAYJNCCLKEMOVA,MONTHCJNEA,#2,CLK3MOVA,YEARANLA,#13HJNBACC.4,CLK2
14资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。ADDA,#2CLK2:ANLA,#3JNZCLK3MOVA,DAYXRLA,#29HJZCLKECLK3:MOVDAY,#1MOVA,MONTHADDA,#1DAAMOVMONTH,ACJNEA,#13H,CLKEMOVMONTH,#1MOVA,YEARADDA,#1DAAMOVYEAR,ACLKE99:CALLCONVERTCLKE:
15资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。POPPSWPOPACCRETIDISP:PUSHPSWPUSHACCMOV23H,R0DISP99:MOVR1,#40HMOVR0,#30HMOVR2,#9DISP1:MOVA,@R0ANLA,#0FHMOV@R1,AMOVA,@R0SWAPAANLA,#0FHINCR1MOV@R1,ADJNZR2,DISP2CALLDISPLAY
16资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVR0,23HPOPACCPOPPSWRETDISP2:INCR1INCR0JMPDISP1DISPLAY:MOVR1,#40HMOVR5,#19SETBAAAPLAY:SETBBBBNOPCLRBBBCLRAAAMOVA,@R1MOVDPTR,#TABMOVCA,@A+DPTRMOVCOM,ACALLDL1MS
17资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVCOM,#0FFHDJNZR5,PLAY1CLRBBBSETBAAARETPLAY1:INCR1JMPPLAYTAB:DB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,0FFH,0A3H,8EH,0ABHDL1MS:MOV25H,R7MOV24H,R6MOVR7,#20DS1:MOVR6,#10DJNZR6,$DJNZR7,DS1MOVR7,25HMOVR6,24HRET
18资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。START_YEAREQU01CONVERT_YEARDATA5CHCONVERT_MONTHDATA38HCONVERT_DATEDATA37HTEMP_BYTE1DATA57HTEMP_BYTE2DATA58HTEMP_BYTE3DATA59HTEMP_BYTE4DATA5AHTEMP_BYTE5DATA5BHCONVERT:MOVA,YEARMOVTIME_YEAR,AMOVA,MONTHMOVTIME_MONTH,AMOVA,DAYMOVTIME_DATA,AMOVA,TIME_YEARMOVB,#16DIVABMOVCONVERT_YEAR,BMOVB,#10MULAB
19资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。ADDA,CONVERT_YEARMOVCONVERT_YEAR,AMOVA,TIME_MONTHJNBACC.4,CON_02CLRACC.4ADDA,#10CON_02:MOVCONVERT_MONTH,AMOVA,TIME_DATAMOVB,#16DIVABMOVCONVERT_DATE,BMOVB,#10MULABADDA,CONVERT_DATEMOVCONVERT_DATE,AMOVDPTR,#MONTH_DATAMOVA,CONVERT_YEARCON_06:CLRCSUBBA,#START_YEARMOVB,#3MULABADDA,DPL
20资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVDPL,AMOVA,BADDCA,DPHMOVDPH,AMOVA,#2MOVCA,@A+DPTRCLRACC.7MOVB,#32DIVABMOVTEMP_BYTE1,AMOVTEMP_BYTE2,BMOVTEMP_BYTE3,#0MOVA,CONVERT_MONTHCJNEA,#10,CON_08CON_08:JCCON_09MOVTEMP_BYTE3,#1CON_09:MOVA,CONVERT_YEARANLA,#03HJNZCON_10MOVA,CONVERT_MONTHLCALLGET_RUN_DAYS_LOWSJMPCON_12
21资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。CON_10:MOVA,CONVERT_MONTHLCALLGET_DAYS_LOWCON_12:MOVB,CONVERT_DATEDECBADDA,BMOVTEMP_BYTE4,AJNCCON_14INCTEMP_BYTE3CON_14:MOVA,TEMP_BYTE1LCALLGET_DAYS_LOWDECAADDA,TEMP_BYTE2MOVTEMP_BYTE5,AMOVA,CONVERT_MONTHCJNEA,TEMP_BYTE1,CON_20MOVA,CONVERT_DATECJNEA,TEMP_BYTE2,CON_20CON_20:JCCON_22LJMPCON_60CON_22:MOVA,CONVERT_YEARJNZCON_24MOVA,#100
22资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。CON_24:DECAMOVCONVERT_YEAR,AMOVA,DPLCLRCSUBBA,#3MOVDPL,AJNCCON_26DECDPHCON_26:MOVA,TEMP_BYTE5CLRCSUBBA,TEMP_BYTE4MOVTEMP_BYTE3,AMOVCONVERT_MONTH,#12CLRF0CLRAMOVCA,@A+DPTRANLA,#0F0HSWAPA;MOVTEMP_BYTE4,AJZCON_30MOVA,#2MOVCA,@A+DPTR
23资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVC,ACC.7MOVA,#1MOVCA,@A+DPTRRLCASJMPCON_34CON_30:MOVA,#1MOVCA,@A+DPTRCON_34:MOVTEMP_BYTE5,ACON_40:MOVA,TEMP_BYTE5RRCAMOVTEMP_BYTE5,AJCCON_42MOVB,#29SJMPCON_44CON_42:MOVB,#30CON_44:MOVA,TEMP_BYTE3CLRCSUBBA,BJZCON_46JNCCON_50CPLAINCA
24资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。CON_46:INCAMOVB,#10DIVABSWAPAORLA,BMOVCONVERT_DATE,AMOVA,CONVERT_MONTHMOVB,#10DIVABSWAPAORLA,BMOVCONVERT_MONTH,AMOVA,CONVERT_YEARMOVB,#10DIVABSWAPAORLA,BMOVCONVERT_YEAR,ACALLWEEKRETCON_50:MOVTEMP_BYTE3,AJBF0,CON_52
25资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DECCONVERT_MONTHCON_52:MOVA,CONVERT_MONTHCJNEA,TEMP_BYTE4,CON_54CPLF0CON_54:SJMPCON_40CON_60:MOVA,TEMP_BYTE4CLRCSUBBA,TEMP_BYTE5MOVTEMP_BYTE4,AJNCCON_62DECTEMP_BYTE3CON_62:MOVCONVERT_MONTH,#1CLRAMOVCA,@A+DPTRMOVTEMP_BYTE5,AANLA,#0F0HSWAPAXCHA,TEMP_BYTE5CLRF0ANLA,#0FHMOVTEMP_BYTE1,AMOVA,#1
26资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVCA,@A+DPTRMOVTEMP_BYTE2,AANLA,#0F0HORLA,TEMP_BYTE1SWAPAMOVTEMP_BYTE1,AMOVA,#2MOVCA,@A+DPTRMOVC,ACC.7MOVA,TEMP_BYTE2ANLA,#0FHSWAPAMOVACC.3,CMOVTEMP_BYTE2,ACON_70:MOVA,TEMP_BYTE2RLCAMOVTEMP_BYTE2,AMOVA,TEMP_BYTE1RLCAMOVTEMP_BYTE1,AJCCON_72MOVB,#29
27资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。SJMPCON_74CON_72:MOVB,#30CON_74:MOVA,TEMP_BYTE4CLRCSUBBA,BJNCCON_78MOVB,AMOVA,TEMP_BYTE3JZCON_76DECTEMP_BYTE3MOVTEMP_BYTE4,BSJMPCON_80CON_76:MOVA,TEMP_BYTE4LJMPCON_46CON_78:MOVTEMP_BYTE4,ACON_80:MOVA,CONVERT_MONTHCJNEA,TEMP_BYTE5,CON_82CPLF0JNBF0,CON_82SJMPCON_70CON_82:INCCONVERT_MONTHSJMPCON_70
28资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。GET_DAYS_LOW:MOVCA,@A+PCRETDB0,31,59,90,120,151,181,212,243,17,48,78GET_RUN_DAYS_LOW:MOVCA,@A+PCRETDB0,31,60,91,121,152,182,213,244,18,49,79MONTH_DATA:DB04DH,04AH,0B8H;DB00DH,04AH,04CH;DB00DH,0A5H,041H;DB025H,0AAH,0B6H;DB005H,06AH,049H;DB07AH,0ADH,0BDH;DB002H,05DH,052H;DB009H,02DH,047H;DB05CH,095H,0BAH;DB00AH,095H,04EH;DB00BH,04AH,043H;
29资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DB04BH,055H,037H;DB00AH,0D5H,04AH;DB095H,05AH,0BFH;DB004H,0BAH,053H;DB00AH,05BH,048H;DB065H,02BH,0BCH;DB005H,02BH,050H;DB00AH,093H,045H;DB047H,04AH,0B9H;2020DB006H,0AAH,04CH;2021DB00AH,0D5H,041H;2022DB024H,0DAH,0B6H;2023DB004H,0B6H,04AH;2024DB069H,057H,03DH;2025DB00AH,04EH,051H;2026DB00DH,026H,046H;2027DB05EH,093H,03AH;2028DB00DH,053H,04DH;2029DB005H,0AAH,043H;2030DB036H,0B5H,037H;2031DB009H,06DH,04BH;2032DB0B4H,0AEH,0BFH;2033
30资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DB004H,0ADH,053H;2034DB00AH,04DH,048H;2035DB06DH,025H,0BCH;2036DB00DH,025H,04FH;2037DB00DH,052H,044H;2038DB05DH,0AAH,038H;2039DB00BH,05AH,04CH;2040DB005H,06DH,041H;2041DB024H,0ADH,0B6H;2042DB004H,09BH,04AH;2043DB07AH,04BH,0BEH;2044DB00AH,04BH,051H;2045DB00AH,0A5H,046H;2046DB05BH,052H,0BAH;2047DB006H,0D2H,04EH;2048DB00AH,0DAH,042H;2049DB035H,05BH,037H;2050DB009H,037H,04BH;2051DB084H,097H,0C1H;2052DB004H,097H,053H;2053DB006H,04BH,048H;2054DB066H,0A5H,03CH;2055
31资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DB00EH,0A5H,04FH;2056DB006H,0B2H,044H;2057DB04AH,0B6H,038H;2058DB00AH,0AEH,04CH;2059DB009H,02EH,042H;2060DB03CH,097H,035H;2061DB00CH,096H,049H;2062DB07DH,04AH,0BDH;2063DB00DH,04AH,051H;2064DB00DH,0A5H,045H;2065DB055H,0AAH,0BAH;2066DB005H,06AH,04EH;2067DB00AH,06DH,043H;2068DB045H,02EH,0B7H;2069DB005H,02DH,04BH;2070DB08AH,095H,0BFH;2071DB00AH,095H,053H;2072DB00BH,04AH,047H;2073DB06BH,055H,03BH;2074DB00AH,0D5H,04FH;2075DB005H,05AH,045H;2076DB04AH,05DH,038H;2077
32资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DB00AH,05BH,04CH;2078DB005H,02BH,042H;2079DB03AH,093H,0B6H;2080DB006H,093H,049H;2081DB077H,029H,0BDH;2082DB006H,0AAH,051H;2083DB00AH,0D5H,046H;2084DB054H,0DAH,0BAH;2085DB004H,0B6H,04EH;2086DB00AH,057H,043H;2087DB045H,027H,038H;2088DB00DH,026H,04AH;2089DB08EH,093H,03EH;2090DB00DH,052H,052H;2091DB00DH,0AAH,047H;2092DB066H,0B5H,03BH;2093DB005H,06DH,04FH;2094DB004H,0AEH,045H;2095DB04AH,04EH,0B9H;2096DB00AH,04DH,04CH;2097DB00DH,015H,041H;2098DB02DH,092H,0B5H;2090
33资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。DB00DH,053H,049H;2100TIME_WEEK1DATA52HWEEK:MOVA,TIME_YEARMOVB,#16DIVABMOVTEMP_BYTE1,BMOVB,#10MULABADDA,TEMP_BYTE1MOVTEMP_BYTE1,AMOVA,TIME_MONTHJBACC.7,GETW02MOVA,#100ADDA,TEMP_BYTE1MOVTEMP_BYTE1,AMOVA,TIME_MONTHCLRACC.7GETW02:JNBACC.4,GETW04ADDA,#10CLRACC.4GETW04:MOVTEMP_BYTE2,A
34资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。MOVA,TIME_DATAMOVB,#16DIVABMOVTEMP_BYTE3,BMOVB,#10MULABADDA,TEMP_BYTE3MOVTEMP_BYTE3,AMOVA,TEMP_BYTE1ANLA,#03HJNZGETW10MOVA,TEMP_BYTE2CJNEA,#3,GETW06GETW06:JNCGETW10DECTEMP_BYTE3GETW10:MOVA,TEMP_BYTE2LCALLGET_CORRECTADDA,TEMP_BYTE1MOVB,#7DIVABMOVA,TEMP_BYTE1
35资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。ANLA,#0FCHRRARRAADDA,BADDA,TEMP_BYTE3MOVB,#7DIVABMOVA,BCJNEA,#0,OUTOUTMOVB,#8OUTOUT:MOVTIME_WEEK,BRETGET_CORRECT:MOVCA,@A+PCRETDB0,3,3,6,1,4,6,2,5,0,3,5END5系统仿真及调试
36资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。6仿真结果及分析上图为运行时的显示,左边两个数码管显示器显示的是年、月、日,
37资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。中间的显示的是时、分、秒,右边显示的是农历日期以及星期。若想要调试时间,可经过右下方两个并联开关调试,左边开关调试数码管显示位置,右边的调试增1。此刻是11月29日下午15:02,星期五,时间准确。6训练体会在整个单片机课程设计中,想要做出这个完整的设计过程,必须突破几个难点:1、元件得找准却,6路驱动能够用74LS244代替。2、连线不能连错,对应的输入输出端标上序号。3、程序代码不能敲错。4、由于单管显示的星期数不稳定,能够采用双管显示。7参考文献:单片机课程设计指导。