• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Spasm said:
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!.
 

Spasm

New Member
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
 

Nigel Goodwin

Super Moderator
Most Helpful Member
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:
 

Exo

Active Member
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
 

Spasm

New Member
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 :p
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top