《PIC单片机电子万历实验分析方案 .docx》由会员分享,可在线阅读,更多相关《PIC单片机电子万历实验分析方案 .docx(6页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精品名师归纳总结试验报告姓名:文可鑫 学号: 20072121010专业:电子信息工程1 编写一个秒表程序,使用查询方式。list p=16f877a includep16f877a.inc include countequ20h count_sequ21horg000h start nopcallInitSPIbanksel OPTION_REG movlw04hmovwfOPTION_REG banksel INTCON movlw00hmovwfINTCON movlw06h movwfTMR0 movlwd131 movwfcount movlw00h movwfcount_smain
2、btfssINTCON,T0IF goto$-1movlw06h movwfTMR0bcfINTCON,T0IFincfcount,f btfssSTATUS,Z gotomain movlwd131 movwfcount incfcount_s,f movfcount_s,w sublwd60 btfscSTATUS,Z clrfcount_s movfcount_s,w callBin2BCDmovfDIS_TEMP2,w callCHAR_CODE1 movwfDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结movfDIS_TEMP1,w callCHAR_CODE1
3、movwfDIS_TEMP1 callLEDlightnopgotomain CHAR_COD。E1共阴极字符表ADDWFPCL,FRETLW 3fh。0RETLW 06h。1RETLW 5bh。2RETLW 4fh。3RETLW 66h。4RETLW 6dh。5RETLW 7dh。6RETLW 07h。7RETLW 7fh。8RETLW 6fh。9Bin2BCDCLRFDIS_TEMP1 MOVWFDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结TtenthOUTendMOVLW.10 SUBWFDIS_TEMP2,W BTFSS STATUS,C GOTO OUT MOV
4、WFDIS_TEMP2 INCFDIS_TEMP1,FGOTO TtenthRETURN可编辑资料 - - - 欢迎下载精品名师归纳总结2 编写一个秒表程序,使用中断方式。list p=16f877a includep16f877a.inc include countequ20h count_sequ21h W_tempequ 23H STA_temp equ 24Horg 000h goto start org 004h goto intp可编辑资料 - - - 欢迎下载精品名师归纳总结start nopcallInitSPIbanksel OPTION_REG movlw44hmovwfO
5、PTION_REG banksel INTCON movlw0a0hmovwfINTCON movlw06h movwfTMR0 movlwd131 movwfcount movlw00h movwfcount_sheregotohere intpbtfssINTCON,T0IF goto$-1movlw06hmovwfTMR0bcfINTCON,T0IFincfcount,f btfssSTATUS,Z gotointp movlwd131 movwfcount incfcount_s,fmovfcount_s,w sublwd60 btfscSTATUS,Z clrfcount_s mov
6、fcount_s,w callBin2BCDmovfDIS_TEMP2,w callCHAR_CODE1 movwfDIS_TEMP2 movfDIS_TEMP1,w callCHAR_CODE1 movwfDIS_TEMP1 callLEDlightnop RETFIECHAR_CODE。1共阴极字符表 ADDWFPCL,F可编辑资料 - - - 欢迎下载精品名师归纳总结RETLW 3fh。0RETLW 06h。1RETLW 5bh。2RETLW 4fh。3RETLW 66h。4RETLW 6dh。5RETLW 7dh。6RETLW 07h。7RETLW 7fh。8RETLW 6fh。9Bi
7、n2BCDCLRFDIS_TEMP1 MOVWFDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结TtenthOUTMOVLW.10 SUBWFDIS_TEMP2,W BTFSS STATUS,C GOTO OUT MOVWFDIS_TEMP2 INCFDIS_TEMP1,FGOTO TtenthRETURN可编辑资料 - - - 欢迎下载精品名师归纳总结end CHAR_CODE。1共阴极字符表 ADDWFPCL,FRETLW 3fh。0RETLW 06h。1RETLW 5bh。2RETLW 4fh。3RETLW 66h。4RETLW 6dh。5RETLW 7dh。6RETL
8、W 07h。7RETLW 7fh。8RETLW 6fh。9Bin2BCDCLRFDIS_TEMP1 MOVWFDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结TtenthMOVLW.10 SUBWFDIS_TEMP2,W BTFSS STATUS,C GOTO OUT MOVWFDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结OUTendINCFDIS_TEMP1,FGOTO Ttenth RETURN可编辑资料 - - - 欢迎下载精品名师归纳总结list p=16f877a includep16f877a.inc include countequ20h
9、count_sequ21horg 000h goto start org 004h goto intpstart nopcallInitSPIbanksel OPTION_REG movlw04hmovwfOPTION_REGbanksel INTCON movlw00h movwfINTCON movlw06h movwfTMR0 movlwd131 movwfcount movlw00h movwfcount_sheregotohereintpbtfssINTCON,T0IF goto$-1movlw06hmovwfTMR0bcfINTCON,T0IFincfcount,f btfssST
10、ATUS,Z gotointp movlwd131 movwfcount incfcount_s,fmovfcount_s,w sublwd60 btfscSTATUS,Z clrfcount_s可编辑资料 - - - 欢迎下载精品名师归纳总结movfcount_s,w callBin2BCDmovfDIS_TEMP2,w callCHAR_CODE1 movwfDIS_TEMP2 movfDIS_TEMP1,w callCHAR_CODE1 movwfDIS_TEMP1 callLEDlightnop RETFIECHAR_CODE。1共阴极字符表ADDWFPCL,FRETLW 3fh。0RETLW 06h。1RETLW 5bh。2RETLW 4fh。3RETLW 66h。4RETLW 6dh。5RETLW 7dh。6RETLW 07h。7RETLW 7fh。8RETLW 6fh。9Bin2BCDCLRFDIS_TEMP1 MOVWFDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结TtenthOUTendMOVLW.10 SUBWFDIS_TEMP2,W BTFSS STATUS,C GOTO OUT MOVWFDIS_TEMP2 INCFDIS_TEMP1,FGOTO Ttenth RETURN可编辑资料 - - - 欢迎下载