>From the help: 302 Register in operand not in bank 0. Ensure that bank bits are correct. This is a commonly seen reminder message to tell you that a variable that is being accessed in not in bank 0. This message was added to remind you to check your code, particularly code in banks other than 0. Review the section on banksel (banksel - Generate Bank Selecting Code) and bankisel (bankisel - Generate Indirect Bank Selecting Code (PIC12/16 MCUs)) and ensure that your code uses bank bits whenever changing from ANY bank to ANY other bank (including bank 0). Since the assembler or linker can't tell which path your code will take, you will always get this message for any variable not in bank 0. You can use the errorlevel command to turn this and other messages on and off, but be careful as you may not spot a banking problem with this message turned off. For more about errorlevel, see errorlevel - Set Message Level. A similar message is 306 for paging. On Apr 1, 2005 9:06 AM, Chetan Bhargava wrote: > Hi All, > > I'm running into a trivial problem. When I access registers from > bank1, I get the errors below, even if I switch the banks. I have > taken this piece of code from PIC16F684 datasheet. Any pointers? > > I have recently upgraded my MPLAB to 7.10.the MPASMWIN version is 4.00. > > Here is a snippet from the list file > > 0005 1683 00014 BSF STATUS,RP0 ;Bank 1 > Message[302]: Register in operand not in bank 0. Ensure that bank > bits are correct. > 0006 0191 00015 CLRF ANSEL ;digital I/O > 0007 300C 00016 MOVLW 0Ch ;Set RC<3:2> as inputs > Message[302]: Register in operand not in bank 0. Ensure that bank > bits are correct. > > > +++++++++++++++++++++++++++++++++++++ > > ;test program > list p=16F684 > include "P16F684.inc" > org 0x00 > goto main > main: > test: > BCF STATUS,RP0 ;Bank 0 > CLRF PORTC ;Init PORTC > MOVLW 07h ;Set RC<4,1:0> to > MOVWF CMCON0 ;digital I/O > BSF STATUS,RP0 ;Bank 1 > CLRF ANSEL ;digital I/O > MOVLW 0Ch ;Set RC<3:2> as inputs > MOVWF TRISC ;and set RC<5:4,1:0> > ;as outputs > BCF STATUS,RP0 ;Bank 0 > end > +++++++++++++++++++++++++++++++++++++ > > Thanks, > > -- > Chetan Bhargava > Web: http://www.bhargavaz.net > Blog: http://microz.blogspot.com > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist