Unexplained warnings in MPLAB X

Thread Starter

Lestraveled

Joined May 19, 2014
1,946
Hi Everybody, I hope someone can identify what I am doing wrong.

I am getting these "Register in operand not in bank zero" warnings when I compile. As you can see I am explicitly setting the bank select bits in the status register before I access the register.

I am playing around with the PWM module. The only line of code you don't see is the "end" statement.

I have verified that the labels in the include file are correct. I have replaced the labels with literals. I have changed the order of statement.

The code functions perfectly but I am still getting the warnings.

Thanks for any assistance you can give me. I will respond with answers to any questions you have.

I appreciate your help

Mark
 

Art

Joined Sep 10, 2007
806
IIRC it's no big deal.
It's just up to you to ensure you set the bank bits are set correctly so your program
doesn't address the same RAM location in BANK0.
 

MMcLaren

Joined Feb 14, 2010
861
Yep, they're just warnings. Some of us just turn 'em off with the "errorlevel" directive...

Regards, Mike

Rich (BB code):
        #include <P16F1823.INC>
        errorlevel -302         ; omit bank warning messages
        list st=off             ; omit symbol table in .LST file
        radix dec

  __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF
  __CONFIG _CONFIG2, _BORV_LO & _LVP_OFF & _PLLEN_OFF
 

JohnInTX

Joined Jun 26, 2012
4,787
Yep, they're just warnings. Some of us just turn 'em off with the "errorlevel" directive...

Regards, Mike

Rich (BB code):
        #include <P16F1823.INC>
        errorlevel -302         ; omit bank warning messages
        list st=off             ; omit symbol table in .LST file
        radix dec

  __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF
  __CONFIG _CONFIG2, _BORV_LO & _LVP_OFF & _PLLEN_OFF
+1. Its worse than worthless. If you don't turn it off, you eventually will wind up with pages of them which makes it easy to miss a more important warning in all the noise.
 

ErnieM

Joined Apr 24, 2011
8,377
I am getting these "Register in operand not in bank zero" warnings when I compile. As you can see I am explicitly setting the bank select bits in the status register before I access the register.
Yep, YOU are doing everything correctly.

The assemble is assuming you are a dunce.

Actually you can muck up bank bits pretty badly but there is no compiler warning to help you out.

Just turn off the warning as suggested and keep telling yourself "everything is going to be all right."
 

Thread Starter

Lestraveled

Joined May 19, 2014
1,946
OK, Thank you all very much...

everything is going to be all right.
everything is going to be all right.
everything is going to be all right.
everything is going to be all right..........
 

Art

Joined Sep 10, 2007
806
Now I remember I was into setting bank select back to zero after accessing
anything in bank one to ensure bank 0 RAM was the fastest to deal with.
 
Top