Unexplained warnings in MPLAB X

Discussion in 'Embedded Systems and Microcontrollers' started by Lestraveled, Jun 11, 2014.

  1. Lestraveled

    Thread Starter Well-Known Member

    May 19, 2014
    1,957
    1,215
    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
     
  2. Lestraveled

    Thread Starter Well-Known Member

    May 19, 2014
    1,957
    1,215
    Here is the screen dump
     
  3. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    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.
     
  4. MMcLaren

    Well-Known Member

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

    Regards, Mike

    Code ( (Unknown Language)):
    1.  
    2.         #include <P16F1823.INC>
    3.         errorlevel -302         ; omit bank warning messages
    4.         list st=off             ; omit symbol table in .LST file
    5.         radix dec
    6.  
    7.   __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF
    8.   __CONFIG _CONFIG2, _BORV_LO & _LVP_OFF & _PLLEN_OFF
    9.  
    10.  
     
  5. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,025
    +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.
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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."
     
  7. Lestraveled

    Thread Starter Well-Known Member

    May 19, 2014
    1,957
    1,215
    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..........
     
    ErnieM likes this.
  8. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    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.
     
Loading...