xxy1990:
你的程序很乱,中断返回没有,有可能陷入死循环.我把修改后的代码给你.你的系统初始化我没有改动.我没有查询,如果可能你最好用c编写. ORG0X00 GOTOmainline ORG0X04 GOTOINT ORG0X50mainline call initial BSFT1CON,0mainloop GOTO mainloopinitial MOVLWB'10101010' MOVWF20 BANKSELTRISB BCFTRISB,1 BANKSELOPTION_REG MOVLWB'10000000' OPTION BANKSELPIE1 BSFPIE1,0 BANKSELINTCON MOVLW0C0H MOVWFINTCON BANKSELT1CON MOVLWB'00110100' MOVWFT1CON MOVLW50H MOVWFTMR1H MOVWFTMR1L return INT BANKSELPIR1 BCFPIR1,TMR1IF MOVLW50H MOVWFTMR1H MOVWFTMR1L BANKSELPORTB BTFSSPORTB,1 GOTOSET1 BCFPORTB,1 retieSET1 BSFPORTB,1 retie END