• AVR Freaks

Hot!PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK

Author
MIKEYOO
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/08/22 01:59:20
  • Location: 0
  • Status: offline
2019/08/23 00:43:10 (permalink)
0

PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK

Hi
I had compiler problem "MPASMX V5.83" as follows
ASM code select bank but after compile it generate warning
"Message[302] C:\PIC\PIC16LF18344-TEST_2019_08_23.ASM 81 : Register in operand not in bank 0.  Ensure that bank bits are correct."
 
My code COMPILER LIST is;
==================================================
000B                  00070 RESET_AA
000B   0183           00071         CLRF    STATUS
000C   0020           00072         BANKSEL PORTA
000D   3000           00073         MOVLW   STARTPORTA
000E   008C           00074         MOVWF   PORTA
000F   3000           00075         MOVLW   STARTPORTB
0010   008D           00076         MOVWF   PORTB
0011   3000           00077         MOVLW   STARTPORTC
0012   008E           00078         MOVWF   PORTC
0013   0021           00079         BANKSEL TRISA
0014   3004           00080         MOVLW   STARTTRISA
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0015   008C           00081         MOVWF   TRISA
0016   3020           00082         MOVLW   STARTTRISB
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0017   008D           00083         MOVWF   TRISB
0018   3000           00084         MOVLW   STARTTRISC
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0019   008E           00085         MOVWF   TRISC
001A   3018           00086         MOVLW   STARTWDT
001B   0021           00087         BANKSEL WDTCON          ; BANK SELECT
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
001C   0097           00088         MOVWF   WDTCON
                      00089        
                      00090
MPASM 5.83  PIC16LF18344-TEST_2019_08_23.ASM   8-23-2019  16:39:02         PAGE  3
==========================================================
 
As the operand BANKSEL deos not work.
Anyone knows why? How can I select desired bank?
 
Thanks fro reading my problem.
Mike
#1

5 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 3008
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK 2019/08/23 13:27:20 (permalink)
    0
    Provided BANKSEL xxx is a valid mnemo, you're requesting to select bank 0x8A when givin TRISA as the argument  :(
    I'd suggest to either use C or thoroughly read the MPASM user manual to get some basic understanding of what you're trying to achieve.
    (The seemingly similar operations on PORTA/B/C do not throw an error because these registers are mapped to nearly every single bank.)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    1and0
    Access is Denied
    • Total Posts : 9623
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK 2019/08/23 13:41:06 (permalink)
    0
    That is a message, not a warning nor an error, to remind you to ensure the banking bits are correct. It is normal.
    #3
    PStechPaul
    Super Member
    • Total Posts : 2375
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: online
    Re: PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK 2019/08/23 13:50:05 (permalink)
    0
    The BANKSEL directives seem to be producing the correct code. Opcodes 0020 and 0021 are for selecting BANK0 and BANK1, respectively. The assembler is not smart enough to keep track of the bank which has been selected at the time an SFR is accessed, so it generates a warning whenever an SFR located in other than BANK0 is used. The warning is useful but you need to verify manually that the correct bank has been selected in each case. You can then turn off that warning to get a clean build:
     
    https://www.microchip.com/forums/m654171.aspx
     
    Some discussion of bank and page selects in Microchip devices (they bit me in the butt when I first experienced PICs when I had experience with 8080, 8085, and Z80):
     
    https://stackoverflow.com/questions/824505/bank-switching-in-pic-assembler
     
    https://www.rs-online.com/designspark/the-curse-of-the-microchip-banksel--pagesel
     

     
    #4
    ric
    Super Member
    • Total Posts : 23581
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK 2019/08/23 14:43:56 (permalink)
    0
    MPASM has always done this for any register that is not in bank 0.
    As mentioned it is a "Message", not an "Error" or a "Warning".
     
    You can suppress it by adding this line to the start of your ASM file.
            errorlevel      -302    ;suppress "not in bank-0" messages



     
     
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    MIKEYOO
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/08/22 01:59:20
    • Location: 0
    • Status: offline
    Re: PIC16LF18344, MPASMX V5.83, BANKSEL TRISA does not change the BANK 2019/08/25 02:50:04 (permalink)
    0
    Thanks for reply.
    It's not an error not a warning and it's normal just inform me selected bank is not bank0.
    I programmed with Assem code 6~7 years ago so I forgot everything and I thought it's problem.
    Now I understand. Thanks
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5