初学PIC,写了个小程序,编译出错 #include <p16f716.inc>发送子程序 list p=16F716,R=HEX #define DX PORTB,2 ;发送口 #define DR PORTB,3 ;接收口 #define LED1 PORTB,4 #define LED2 PORTB,5 #define LED3 PORTB,6 status equ 3h rp0 equ 5h ;页选择位RP0 portb equ 6h ;RB数据寄存器 intcon equ 0bh ;中断控制寄存器 pir1 equ 0ch ;第一中断 tmr2 equ 11h ;T2 t2con equ 12h adres equ 1eh ;AD存储器 adcon0 equ 1fh ;AD控制寄存器0 potion_reg equ 81h ;RB口上拉使能 trisa equ 85h ;RA的方向寄存器 trisb equ 86h ;RB方向寄存器 pr2 equ 92h ;周期寄存器 adcon1 equ 9fh ;AD控制寄存器1
pow_u equ 20h ;电池电压存储地址 sun_u equ 21h ;太阳能电池电压存储地址 chg_u equ 22h ;充电板电压存储地址 w_back equ 23h ;中断保护寄存器 DCNT equ 24h ;延时 X_CNT equ 25h XmtReg equ 26h ORG 0000H nop goto main org 0004h main nop bsf status, 5 ;选择1区 movlw 0h ;设定AN0-AN3为AD口
;********以下几行有错????????????? [41] movwf adcon1 movlw 0eh ;设定RA口AD转换口为输入状态 [43] movwf trisa movlw 08h ;设定RB3为输入,其他为输出 [45] movwf trisb movlw 0fh ;0000 111 1 [47] movwf potion_reg ;接收口RB3上拉,内部时钟,T0给WTD movlw 0ffh [49] movwf pr2 ;定时周期 ... 提示错误如下: Message[302] H:MPLAB6.6MYPROJ716.ASM 41 : Register in operand not in bank 0. Ensure that bank bits are correct. Message[302] H:MPLAB6.6MYPROJ716.ASM 43 : Register in operand not in bank 0. Ensure that bank bits are correct. Message[302] H:MPLAB6.6MYPROJ716.ASM 45 : Register in operand not in bank 0. Ensure that bank bits are correct. Message[302] H:MPLAB6.6MYPROJ716.ASM 47 : Register in operand not in bank 0. Ensure that bank bits are correct. Message[302] H:MPLAB6.6MYPROJ716.ASM 49 : Register in operand not in bank 0. Ensure that bank bits are correct.
|