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