《《专业综合实践》实习报告_单片机智能数字钟设计.doc》由会员分享,可在线阅读,更多相关《《专业综合实践》实习报告_单片机智能数字钟设计.doc(77页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、实 习 报 告实习名称: 专业综合实践 学生姓名: 学院名称: 电气与信息工程学院 专业班级: 电子XX41 学 号: 10位学号 成 绩 评 定考核内容实习表现实习报告实习成果或答辩综合评定成绩成绩2011年7月20日实习纪律要求和成绩考核办法(纪律要求和成绩考核办法在封皮背面打印)1实习必须听从教师指导,严格遵守安全操作规程。不准违规操作,未经指导教师允许不准启动任何非自用设备、仪器、工具等;操作项目和内容必须按实习要求进行,特别要注意防止电烙铁烧烫伤、不用时要及时切断电源。2实习教室内不准吸烟、吃零食,不准带无关人员到实习教室活动,否则扣平时表现分。3参加本次实习时间不足三分之二或旷课3
2、天以上者,不得参加本次考核,按不及格处理。4病事假必须有请假条,需经班主任或有关领导批准,否则按旷课处理。5实习过程考核和实习成绩在教师手册中要有记载。6实习成绩的考核由指导教师根据实习表现(出勤、遵守纪律情况等)、实习报告、实习成果、现场操作、口试或笔试等几个方面,给出各项成绩或权重,综合后给出实习总成绩。该实习经考核教研室主任审核,主管院长审批备案。7成绩评定采用五级分制,即优、良、中、及格、不及格。8实习结束一周内,指导教师提交实习成绩和实习总结。实习报告要求实习报告内容、格式各专业根据实习类别(技能实习、认识实习、生产实习、毕业实习等)统一规范,经教研室主任审核、主管院长审批备案。注意
3、: 1实习任务书和实习指导书在实习前发给学生,实习任务书放置在实习报告封面后和正文目录前。2为了节省纸张,保护环境,便于保管实习报告,统一采用A4纸,实习报告建议双面打印(正文采用宋体五号字)或手写,左侧装订,订两个钉。智能数字钟的设计一、设计任务与要求功能:1). 全日历计时。2). 12/24小时转换。3). 8路定时输出(可关/开控制)4). 误差:15S+1uS5). 大、小月,润年,周,自动追踪2. 调校:上电后,电子钟显示“1:00”。1). 8路定时时间查询按下K1键依此显示8路定时时间。星期位显示:“H”表示:打开当前定时输出;“L” 表示:关闭当前定时输出。此时按K2键可进行
4、“H”、“L”的切换。所有输出,均由蜂鸣器输出!2). 显示状态的控制按下K2键可进入以下工作状态:12小时/ 日月交替显示。12小时固定显示。24小时/ 日月交替显示。24小时固定显示。3). 校时按下K2键3S后,进入校时菜单。按下K1键依次进入校时状态:分、时、天、月、年、微调系数。此时按K2键,完成+1。当显示“d”时,表示要调整微调系数(0-99),其值越小,时钟走时越慢。当使用的6MHz的晶振偏差大时,应仔细调整微调系数!当显示“out”时,按K2键,即可退出!退出后,按任意键即可启动时钟。4). 设置定时时间按下K1键3S后,进入设置菜单。按下K1键依次进入8路定时调整状态:时、
5、分。此时按K2键,完成+1。当显示“out”时,按K2键,即可退出!3.使用单片机89C2051完成。4.原理图和双面PCB图。5.源程序烧录、调试。6.焊接、安装、调试、验收。;*;all_clk1 _program 2010-3-25;*fl_250ms bit 00hfl_500ms bit fl_250ms+1set_clk_f bit fl_500ms+1set_al4_f bit set_clk_f+1am_f bit set_al4_f+1fl_3s bit am_f+1al1_f bit fl_3s+1al2_f bit fl_3s+2al3_f bit fl_3s+3al4_
6、f bit fl_3s+4set_over bit al4_f+1 ha_f bit set_over+1ha_over bit ha_f+1fl_ms_f bit ha_over+1fl_s_f bit fl_ms_f+1 key_over bit fl_s_f+1;* key_data equ 08htimers equ key_data+1t_30ms equ timers+1t_20ms equ t_30ms+1t_1s equ t_20ms+1k1_data equ t_1s+1k2_data equ k1_data+1stat_work equ k2_data+1stat_led
7、equ stat_work+1t_1ms equ stat_led+1t_20m equ t_1ms+1 beep equ t_20mal1 equ beep+1al2 equ beep+2al3 equ beep+3al4 equ beep+4al5 equ beep+5al6 equ beep+6al7 equ beep+7al8 equ beep+8ret_timer equ al8+1;* sec equ 23hmin equ sec+1hhour equ min+1hday equ hour+1hmon equ day+1hyear equ mon+1hw_adj equ year+
8、1h week equ w_adj+1h;*al1_h equ week+1hal1_m equ al1_h+1hal2_h equ al1_m+1hal2_m equ al2_h+1hal3_h equ al2_m+1hal3_m equ al3_h+1hal4_h equ al3_m+1hal4_m equ al4_h+1hal5_h equ al4_m+1hal5_m equ al5_h+1hal6_h equ al5_m+1hal6_m equ al6_h+1hal7_h equ al6_m+1hal7_m equ al7_h+1hal8_h equ al7_m+1hal8_m equ
9、 al8_h+1hbeep_t equ al8_m+1frist equ beep_t+1;* led1 equ frist+1led2 equ led1+1led3 equ led2+1led4 equ led3+1led5 equ led4+1sp_data equ led5+1;* led_1 bit p3.5led_2 bit p3.4led_3 bit p3.3led_4 bit p3.2led_5 bit p3.1beep_f BIT P3.7key_f bit p3.0;* t_h_100ms equ 05dh ;100 ms for 6MHzt_l_100ms equ 07fh
10、 ;c6 for 100ms timer_no equ 8d ;3c90+30d=3cb0hw_adj_dat equ 50dkey_da equ 00000110b;* blk_led equ 20d dot_led equ 21d f_led equ 22d n_led equ 23d u_led equ 24d t_led equ 25d b_led equ 26d d_led equ 27d ORG 0000H; ;SJMP start ORG 0003H; ;reti;ORG 000BH ;ajmp t0reti ;ORG 0013H reti ;ORG 001BH ;aJMP T1
11、 ;ORG 0023H ;RETI; AJMP RS_485 ;* start: call clr_ramMOV SP,#sp_data ;call int_t0call timer_intcall timer_20msSTAR_BI:call clock call week_autocall al_outCALL KEY_bordcall key_del call set_clk_alcall key_jmp call rebackcall led_jmpsjmp star_bi ;*reback:mov a,stat_workjz reback_endjb al1_f ,ka1mov re
12、t_timer,secsetb al1_f sjmp reback_endka1: mov a,ret_timeradd a,#05dmov b,#60ddiv abmov a,seccjne a,b,reback_endclr al1_fmov stat_work,#00dreback_end:retkey_jmp:mov a,key_datajz key_jmp_end mov ret_timer,seccjne a,#01d,kk1mov a,stat_workinc a ;k1_keycjne a,#9d,kka1mov a,#00dkka1: mov stat_work ,asjmp
13、 key_jmp_end kk1:mov a,stat_work ;k2_keyjnz kk2mov a,stat_ledinc acjne a,#05d,kka2mov a,#00dkka2:mov stat_led,asjmp key_jmp_endkk2:acall all1cpl amov r0,akey_jmp_end:retall1:mov r0,#al1mov a,stat_workdec aadd a,r0mov r0,amov a,r0retled_jmp:;*;mov stat_work,#01d;mov stat_tw,#01dmov a,stat_workjnz led
14、_al1mov a,stat_ledacall led_t_d mov led1,weeksjmp led_jmp_endled_al1:acall all1mov led1,#f_ledjnz le_t2mov led1,#n_ledle_t2:jb fl_250ms ,le_t4mov led1,#blk_ledle_t4:acall al_led led_jmp_end:acall ledret;*time_24:mov a,houracall bcd_8mov led2,ajnz tim4mov led2,#blk_ledtim4:mov led3,bjb fl_500ms,tim1m
15、ov a,badd a,#10dmov led3,a tim1: acall led_mintime_12_end:ret;* led_min:mov a,minacall bcd_8jb fl_500ms ,tim2add a,#10dtim2: mov led4,amov led5,bret;*date_led:mov a,monacall bcd_8mov led2,ajnz da1mov led2,#blk_ledda1: mov a,badd a,#10dmov led3,amov a,dayacall bcd_8mov led4,ajnz da2mov led4,#blk_ledd
16、a2: mov led5,bdate_led_end:ret;*; D_8=BCD;*BCD_8: MOV B,#10DDIV ABRET;*LED: mov p1,#0mov dptr,#led_asc;*led1mov a,led1movc a,a+dptrmov p1,aclr led_1acall timer_1msacall timer_1ms;acall timer_1ms;acall timer_1ms;acall timer_1mssetb led_1;*led2 led_led2:mov a,led2movc a,a+dptrmov p1,aclr led_2acall ti
17、mer_1mssetb led_2;*led3 led_led3:mov a,led3movc a,a+dptrmov p1,aclr led_3acall timer_1mssetb led_3;*led4 led_led4:mov a,led4movc a,a+dptrmov p1,aclr led_4acall timer_1mssetb led_4;*led5 led_led5:mov a,led5movc a,a+dptrmov p1,aclr led_5acall timer_1mssetb led_5;* led_end:mov p1,#0ret;*; bafhcdeg led_
18、asc:db 11101110B;0db 10001000B;1db 11000111B;2db 11001101B;3db 10101001B;4db 01101101B;5db 01101111B;6db 11001000B;7db 11101111B;8db 11101101B;9db 11111110B;0. =10ddb 10011000B;1.db 11010111B;2.db 11011101B;3.db 10111001B;4.db 01111101B;5.db 01111111B;6.db 11011000B;7.db 11111111B;8.db 11111101B;9.D
19、B 00000000B;BLACK=20dDB 00010000B;dot=21dDB 00100110b;l=22ddB 10101011B;h=23dDB 10101110B;u=24dDB 00100111B;t=25ddB 00101111B;b=26ddB 10001111B;d=27d; bafhcdeg ;*;delay;*timer_1ms:mov t_1ms,#030hr2_1: djnz t_1ms , r2_1 rettimer_20ms:mov t_20m,#050dr2_2: call clockcall leddjnz t_20m , r2_2 call week_
20、autocall al_outret;#;if monweek=mod(5/4*year+mon_asc(mon)+day-1)/7;else; gs2=week=mod(5/4*year+mon_asc(mon)+day)/7week_auto: mov a,YEARmov b,#05mul abmov r4,bmov r5,amov r7,#04call mul_2MOV DPTR,#MON_ASCMOV A,MONdec aMOVC A,A+DPTRADD A,r3;*MOV B,DAYADD A,Bmov r3,a;r3=gs2;*jb mon=2 *MOV A,MONCJNE A,#
21、02D,WEEK_1SJMP WEEK_2WEEK_1:JC WEEK_2week_3: mov a,r3mov b,#07div abmov a,bsjmp week_4WEEK_2:;*jb year=4N *mov a,yearmov b,#04div abmov a,bjnz week_3mov a,r3dec amov b,#07div abmov a,b week_4:MOV WEEK,ajnz week_endmov week,#07hweek_end: RETMON_ASC:DB 6d, 2d, 2d, 5d, 0d, 3d, 5d, 1d, 4d, 6d, 2d, 4d ;2
22、002.5.5;r4r5/r7=r3mul_2:D457: CLR CMOV A,R4SUBB A,R7JC DV50SETB OV RETDV50: MOV R6,#8 ;;求平均值(R4R5R7R3)DV51: MOV A,R5RLC AMOV R5,AMOV A,R4RLC AMOV R4,AMOV F0,CCLR CSUBB A,R7ANL C,/F0JC DV52MOV R4,ADV52: CPL CMOV A,R3RLC AMOV R3,ADJNZ R6,DV51MOV A,R4 ;;四舍五入ADD A,#0;R4JC DV53SUBB A,R7JC DV54DV53: INC R
23、3DV54: CLR OVRET;*clr_ram:MOV R7,#78h ;MOV R0,#0bH ;CLR A ;CR: INC R0 ;MOV R0,A ;djnz r7,cr ;CLR RAMret;* INT_CTRLint_t0:setb et1MOV TMOD,#00010001b ;mov w_adj,#w_adj_datsetb eajmp adj_w;*al_led:mov r0,#al1_hmov a,stat_workdec arl aadd a,r0mov r0,amov a,r0acall bcd_8mov led2,ajnz al_1mov led2,#blk_l
24、edal_1:mov a,badd a,#10dmov led3,ainc r0mov a,r0acall bcd_8add a,#10dmov led4,amov led5,bal_led_end:ret;*set_clk_al:jnb set_clk_f,see1call set_clockclr set_clk_fsjmp see2see1:jnb set_al4_f,see2call set_al4clr set_al4_fsee2: ret ;*proc led_t_dled_t_d:mov dptr,#led_ord_3mov b,#02hmul abjmp a+dptrled_o
25、rd_3: ajmp led_k0_2ajmp led_k1_2ajmp led_k2_2ajmp led_k3_2ajmp led_k4_2led_k0_2: ; timer_12 and date to ledacall time_12jnb fl_3s ,lk1acall date_led lk1:ajmp led_jmp_5_endled_k1_2: ; timer_12 to ledacall time_12ajmp led_jmp_5_endled_k2_2: ;timer_24and date to led acall time_24jnb fl_3s ,lk2acall dat
26、e_led lk2:ajmp led_jmp_5_endled_k3_2: ;timer_24to ledacall time_24ajmp led_jmp_5_endled_k4_2: ;sec to ledmov led1,#blk_ledmov led2,#blk_ledmov led3,#dot_ledmov a,secacall bcd_8add a,#10dmov led4,amov led5,b led_jmp_5_end: retend;*proc set_al4set_al4:mov k1_data,#01dmov k2_data,#01dclr set_over acall
27、 led_alacall key_bordcall sf_keymov key_data,#0mov frist,#0set_al41:call clockcall week_autoacall led_alacall key_bordcall key_delacall key_aljnb set_over,set_al41 clr amov k1_data,amov k2_data,amov key_data,amov frist,aretend;*proc key_alkey_al:mov a,key_datajz key_al_endcjne a,#01d,k2_alinc k1_dat
28、a ;(1-9)mov a,k1_datacjne a,#19d,key_al_endmov k1_data,#01dsjmp key_al_end k2_al:mov a,k1_datacjne a,#018d,ke2setb set_oversjmp key_al_endke2: mov r0,#al1_hdec aadd a,r0mov r0,ainc r0acall jj_bitmov b,#24djnz ke3 mov b,#60dke3:mov a,r0div abmov a,bmov r0,akey_al_end:retend jj_bit:mov a,k1_datamov b,
29、#02ddiv abmov a,b ;(a=1,0)ret;* led_out1:mov led2,#00hmov led3,#u_ledmov led4,#t_ledmov led5,#blk_ledmov led1,#blk_ledret;*led_al:mov a,k1_datacjne a,#017d,lo1acall beep_timer sjmp led_al_endlo1: cjne a,#18d,ld1acall led_out1sjmp led_al_endld1: inc amov b,#02ddiv ab;*mov led1,a;*dec arl amov r0,#al1
30、_hadd a,r0mov r0,amov a,r0acall bcd_8mov led2,ajnz ld2mov led2,#blk_ledld2: mov a,badd a,#10dmov led3,a;* inc r0mov a,r0acall bcd_8add a,#10dmov led4,amov led5,b;*flash bitjb fl_250ms,led_al_endacall jj_bitjnz led_al_emov led4,#blk_ledmov led5,#blk_ledsjmp led_al_endled_al_e:mov led2,#blk_ledmov led
31、3,#blk_ledled_al_end:acall ledret;*proc set_clockset_clock:mov k1_data,#01dmov k2_data,#01dclr set_over call led_clcall key_bordcall sf_keymov key_data,#0mov frist,#0set_al41:call clockacall week_autocall al_outacall led_clacall key_bordcall key_delacall key_cljnb set_over,set_al41 ;acall key_bordcl
32、r amov k1_data,amov k2_data,amov key_data,amov frist,aretend;*proc key_clkey_cl:mov a,key_datajz key_al_endcjne a,#01d,k2_alinc k1_data ;(1-8)mov a,k1_datacjne a,#9d,key_al_endmov k1_data,#01dsjmp key_al_end k2_al:mov a,k1_datacjne a,#08d,ke2setb set_oversjmp key_al_endke2: dec amov dptr,#asc_hmovc
33、a,a+dptrmov b,a ;* mov r0,#secmov a,k1_datadec aadd a,r0mov r0,ainc r0mov a,r0div abmov a,bmov r0,akey_al_end:retend asc_h:db 60d,60d,24d,32d,13d,100d,100dproc led_clled_cl:mov dptr,#led_ord_3mov a,k1_datadec amov b,#02hmul abjmp a+dptrled_ord_3: ajmp led_k0_2ajmp led_k1_2ajmp led_k2_2ajmp led_k3_2a
34、jmp led_k4_2ajmp led_k5_2ajmp led_k6_2ajmp led_k7_2led_k0_2: ; led secmov led2,#blk_ledmov led3,#dot_ledmov a,secacall bcd_8add a,#10dmov led4,amov led5,bjb fl_250ms ,lk1mov led4,#blk_ledmov led5,#blk_led lk1: ajmp led_jmp_5_endled_k1_2: ; led min,houracall led_hourjb fl_250ms ,lk2mov led4,#blk_ledm
35、ov led5,#blk_led lk2: ajmp led_jmp_5_endled_k2_2: ;led min,hour acall led_hourjb fl_250ms ,lk3mov led2,#blk_ledmov led3,#blk_led lk3: ajmp led_jmp_5_endled_k3_2: ;led day,monacall led_monjb fl_250ms ,lk4mov led4,#blk_ledmov led5,#blk_led lk4: ajmp led_jmp_5_endled_k4_2: ; led day,monacall led_monjb
36、fl_250ms ,lk5mov led2,#blk_ledmov led3,#blk_led lk5: ajmp led_jmp_5_endled_k5_2: ; led yearmov led2,#2dmov led3,#0dmov a,yearacall bcd_8mov led4,amov led5,bjb fl_250ms ,lk6mov led4,#blk_ledmov led5,#blk_led lk6: ajmp led_jmp_5_endled_k6_2: ;led w_adj mov led2,#d_ledmov led3,#blk_ledmov a,w_adjacall
37、bcd_8mov led4,amov led5,bjb fl_250ms ,lk7mov led4,#blk_ledmov led5,#blk_led lk7: ajmp led_jmp_5_endled_k7_2: ;led outacall led_out1led_jmp_5_end:mov led1,weekacall ledretendled_hour:mov a,houracall bcd_8mov led2,ajnz lj1mov led2,#blk_led lj1: mov a,badd a,#10dmov led3,a;* mov a,minacall bcd_8add a,#10dmov led4,amov led5,bretled_mon:mov a,monjnz lj5inc monmov a,mon lj5:acall bcd_8mov led2,ajnz lj2mov led2,#blk_ledlj2: mov led3,b;* mov a,dayjnz lj4inc daymov a,day lj4:acall bcd_8mov led4,ajnz lj3mov led4,#blk_led lj3: mov led5,bret;*