Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 9th January 2004, 04:43 AM   (permalink)
Default Question on Bank select

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
Spasm is offline  
Old 9th January 2004, 07:02 AM   (permalink)
Default Re: Question on Bank select

Quote:
Originally Posted by Spasm
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!.
Nigel Goodwin is offline  
Old 9th January 2004, 07:08 AM   (permalink)
Default

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 is offline  
Old 9th January 2004, 07:17 AM   (permalink)
Default

Quote:
Originally Posted by Spasm
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:
Nigel Goodwin is offline  
Old 9th January 2004, 05:52 PM   (permalink)
Default

Quote:
Originally Posted by Spasm
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
Exo is offline  
Old 10th January 2004, 01:09 PM   (permalink)
Default

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
Spasm is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:13 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker