Searching \ for 'Code problem?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=code+problem
Search entire site for: 'Code problem?'.

Truncated match.
PICList Thread
'Code problem?'
1999\01\04@152727 by brooksg

flavicon
face
hey, a fresh beginner here -
I am programming a 16c924 and here is a portion of my code pertaining to
my problem ;

OPTREG     equ     0x81
RBPU          equ       7
..
                   bcf     OPTREG,RBPU     ;enable pull-up for switch
...
Now the message that I get after compiling is this..

essage[302] C:\MPLAB40\AY0438.ASM 80 : Register in operand not in bank
0.  Ensure that bank bits are correct.

Now is this something I should worry about or what am I not seeing here?

Thanks for the help. I hope I supplied enough info for the problem.

Gary

1999\01\04@155612 by brooksg

flavicon
face
hey, a fresh beginner here -
I am programming a 16c924 and here is a portion of my code pertaining to

my problem ;

OPTREG     equ     0x81
RBPU          equ       7
..
                   bcf     OPTREG,RBPU     ;enable pull-up for switch
...
Now the message that I get after compiling is this..

essage[302] C:\MPLAB40\AY0438.ASM 80 : Register in operand not in bank
0.  Ensure that bank bits are correct.

Now is this something I should worry about or what am I not seeing here?

Thanks for the help. I hope I supplied enough info for the problem.

Gary

1999\01\04@162046 by Ralph Stickley

flavicon
face
Gary,
To remove the warning message use the following at the top of your file
(only do this after you have verified that the proper bank is properly
selected!:-)

ERRORLEVEL -302                 ;remove message about using proper bank

Even if you have inserted the banksel command, you will still get the same
warning (not an overly intellegent assembler here).  Turn off these warning
messages after you simulate / test your
code. (Turn them back on everynow and then and verify that you are in the
correct bank ).

Also, try to find the file:

#include  p16C924.inc

or similiar - you should not enter the definitions for the on-chip
registers, any errors
you enter here will quickly send you up the wrong creek.

Good luck
Ralph

Gary Brooks wrote:

{Quote hidden}

1999\01\04@170015 by Michael J. Ghormley

flavicon
face
I would also add that I might use this in my code:

#DEFINE         cRBPU           OPTION_REG,7
...
       BCF     cRBPU
...

The "OPTION_REG" is your 16C924.INC's definition for the option register and I
would use it per Ralph's advice.

Michael

* TAKE THE '.NOSPAM' OUT OF MY ADDRESS TO REPLY
**********************************************
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too hard to read anyway!
                                 Groucho Marx
**********************************************

1999\01\04@172028 by evan

picon face
> Gary Brooks wrote:
> I am programming a 16c924 and here is a portion of my code pertaining to
> my problem ;
>
> OPTREG     equ     0x81
> RBPU          equ       7
> ..
>                     bcf     OPTREG,RBPU     ;enable pull-up for switch
> ...
> Now the message that I get after compiling is this..
>
> essage[302] C:\MPLAB40\AY0438.ASM 80 : Register in operand not in bank
> 0.  Ensure that bank bits are correct.
>
> Now is this something I should worry about or what am I not seeing here?

Nothing to worry about, if you've selected the correct RAM bank prior to
line 80.

The RAM in the PIC is located in multiple banks.  Each bank only has 7 bits
for addressing, i.e. a range of 0 to 7F within each bank.  (This is due to
the opcode only allowing 7 bits for the file register address.)  The upper
bit, which selects between the RAM banks, must be set separately in the
STATUS register.

In your code, the assembler simply detected that the file register OPTREG
has a value greater than 7F and thus must be located in bank 1 (or higher,
depending on the processor).  The assembler is simply warning you to ensure
you've explicitly selected the correct RAM bank before addressing the file
register (the assembler has no way of knowing this automatically, thus you
will get this warning whether it's set correctly or not).  And in case
you're wondering, in a PIC with only 2 RAM banks (I'm not familiar with the
'924) Bank 1 is selected by:

       bsf     STATUS, RP0

A small recommendation is to download & use p16c924.inc from Microchip,
which contains standard definitions for all their registers & bits.  Will
save you time and make your code easier to read (and debug) by others on the
piclist.

-Ed V
Agile Controls

1999\01\05@064031 by Caisson

flavicon
face
> Van: Gary Brooks <spam_OUTbrooksgTakeThisOuTspamtdsnet.com>
> Aan: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
> Onderwerp: Code problem?
> Datum: maandag 4 januari 1999 21:27
>
> hey, a fresh beginner here -
> I am programming a 16c924 and here is a portion of my code pertaining to
> my problem ;
<Snip>

> Now the message that I get after compiling is this..
>
> Message[302] C:\MPLAB40\AY0438.ASM 80 : Register in operand not in bank
> 0.  Ensure that bank bits are correct.
>
> Now is this something I should worry about or what am I not seeing here?

It's a warning.  You used a register that is not in Bank #0.  If you forgot
to switch-over to the correct bank strange effects could occur.  For
example MOVWF PORTA and MOVWF TRISA are coded exacly the same (don't take
my word for it. check it !).  Only because you write into differtent bank's
the target will be PORT or TRIS ...

Its sort like the message :  "You are leaving your home : Are you sure that
you have got your keys with you ?"

Greetz,
 Rudy Wieser

1999\01\06@132033 by

flavicon
face
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...