Question on Bank select

Status
Not open for further replies.

Spasm

New Member
Hey all,

I'm writing this code for PIC. When I select the bank 1 for my 16f877, i use

BSF STATUS,RP0

followed by

CLRF TRISC
BSF TRISC, 2
BSF PIE1, CCP1IE

for using input capture.
When compiling, the compilers says the operand(in this case TRISC and PIE1) is not in bank 0. Why does it say not in bank 0 when I've changed the status to bank 1? Anyone can help?

Thanx
 

It's a standard warning from MPASM that you are accessing something not in bank 0 - you can alter the warning level to stop it, but it stops other warnings as well. Best thing is to just ignore it!.
 
Allrite....
Thanx nigel....i was trying to figure why for such a long time. :?
But why if I write like

CLRF TRISC & 7F

it has no message?


Thank you
 
Spasm said:
Allrite....
Thanx nigel....i was trying to figure why for such a long time. :?
But why if I write like

CLRF TRISC & 7F

it has no message?


Thank you

I've no idea - nor why you would do that in the first place :lol:
 
Spasm said:
Allrite....
Thanx nigel....i was trying to figure why for such a long time. :?
But why if I write like

CLRF TRISC & 7F

it has no message?


Thank you

It's not the CLRF instruction that generates the bank bits warning message, it's the BSF STATUS, RP0 that generates it

but why would you use such an instructions
what you are doing is clearing the file on adress TRISC(87H) & 7F
 
Hey.

I'm not sure why the instruction is that way because that's how my fren taught me to clear the message instruction. Guess it doesnt matter now since the messages doesnt play important roles
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…