Patrick J wrote: > When the code below is compiled I get this error msg: > "AN607.ASM 51 : Register in operand not in bank 0. Ensure that bank bits are correct." > I have tried switching to bank0, and bank1, it doesnt help There is no problem with your code. The assembler is just reminding you that TRISB is in RAM Page 1 and make sure you have the bank bits set properly which you have done. Some other problems.... The LVP fuse bit will default to LVP mode so RB3 will be used for low voltage program enable. You must set it to '0' so that RB3 becomes a digital IO. At the moment, I gather the pin is unconnected so it will be floating on powerup and may cause problems. You have not set ADCON1, so all analog pins will be in analog mode. In this simple case it doesn't matter though. You should really set all unused pins as outputs. Even this test program may be affected by pins that float around as unconnected inputs. BSF BCF type instructions are not recommended on ports one after the other. Place a NOP between them or write directly to the port. > BSF PORTB, 7 ; port B, bit7:=High > BCF PORTB, 7 ; port B, bit7:=Low If you use this code line after the LIST line.... #include "p16f877.inc" These following lines become predefined for you as they are declared in the above file. > > _CP_OFF EQU H'3FFF' > _WDT_OFF EQU H'3FFB' > _XT_OSC EQU H'3FFD' > _PWRTE_ON EQU H'3FF7' > > __FUSES ( _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON ) > > RP1 EQU H'0006' ; STATUS Bits > RP0 EQU H'0005' ; STATUS Bits > > STATUS EQU H'0003' ; > PORTB EQU H'0006' ; (avail only when Bank=0) > TRISB EQU H'0086' ; (avail only when Bank=1) > -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body