PIC单片机电子万历实验分析方案 .docx
精品名师归纳总结试验报告姓名:文可鑫 学号: 20072121010专业:电子信息工程1 编写一个秒表程序,使用查询方式。list p=16f877a include"p16f877a.inc" include<leddis.inc> countequ20h count_sequ21horg000h start nopcallInitSPIbanksel OPTION_REG movlw04hmovwfOPTION_REG banksel INTCON movlw00hmovwfINTCON movlw06h movwfTMR0 movlwd'131' movwfcount movlw00h movwfcount_smainbtfssINTCON,T0IF goto$-1movlw06h movwfTMR0bcfINTCON,T0IFincfcount,f btfssSTATUS,Z gotomain movlwd'131' movwfcount incfcount_s,f movfcount_s,w sublwd'60' btfscSTATUS,Z clrfcount_s movfcount_s,w callBin2BCDmovfDIS_TEMP2,w callCHAR_CODE1 movwfDIS_TEMP2可编辑资料 - - - 欢迎下载精品名师归纳总结movfDIS_TEMP1,w callCHAR_CODE1 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 MOVWFDIS_TEMP2 INCFDIS_TEMP1,FGOTO TtenthRETURN可编辑资料 - - - 欢迎下载精品名师归纳总结2 编写一个秒表程序,使用中断方式。list p=16f877a include"p16f877a.inc" include<leddis.inc> countequ20h count_sequ21h W_tempequ 23H STA_temp equ 24Horg 000h goto start org 004h goto intp可编辑资料 - - - 欢迎下载精品名师归纳总结start nopcallInitSPIbanksel OPTION_REG movlw44hmovwfOPTION_REG banksel INTCON movlw0a0hmovwfINTCON movlw06h movwfTMR0 movlwd'131' movwfcount movlw00h movwfcount_sheregotohere intpbtfssINTCON,T0IF goto$-1movlw06hmovwfTMR0bcfINTCON,T0IFincfcount,f btfssSTATUS,Z gotointp movlwd'131' movwfcount incfcount_s,fmovfcount_s,w sublwd'60' 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,F可编辑资料 - - - 欢迎下载精品名师归纳总结RETLW 3fh。0RETLW 06h。1RETLW 5bh。2RETLW 4fh。3RETLW 66h。4RETLW 6dh。5RETLW 7dh。6RETLW 07h。7RETLW 7fh。8RETLW 6fh。9Bin2BCDCLRFDIS_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。6RETLW 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 include"p16f877a.inc" include<leddis.inc> countequ20h count_sequ21horg 000h goto start org 004h goto intpstart nopcallInitSPIbanksel OPTION_REG movlw04hmovwfOPTION_REGbanksel INTCON movlw00h movwfINTCON movlw06h movwfTMR0 movlwd'131' movwfcount movlw00h movwfcount_sheregotohereintpbtfssINTCON,T0IF goto$-1movlw06hmovwfTMR0bcfINTCON,T0IFincfcount,f btfssSTATUS,Z gotointp movlwd'131' movwfcount incfcount_s,fmovfcount_s,w sublwd'60' 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可编辑资料 - - - 欢迎下载