Searching \ for '[PIC]:MPLAB Warnings' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/languages.htm?key=mplab
Search entire site for: 'MPLAB Warnings'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:MPLAB Warnings'
2002\01\14@130811 by Renzo Giurini

flavicon
face
I try to compile the following lines,part of a program for Pic16f84a, and I
get in line <2> the
"Message[302] : Register in operand not in bank 0.  Ensure that bank bits
are correct".

and in line <5> a "Warning[202]  : Argument out of range.  Least
significant bits used".

I think that instructions are correct. Why those messages?

1               bsf     STATUS,RP0      ;select memory register page 1
2               clrf    TRISB           ;make Port B output by clearing TRISB
3               bcf     STATUS,RP0      ;go back to register page 0

Main
4               ;movlw  01010101B       ;move 01010101 into W and
5               ;movwf  PORTB           ;output patter

Thanks
Renzo Giurini

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\14@133800 by Jeff DeMaagd

flavicon
face
At 07:05 PM 1/14/02 +0100, you wrote:
>I try to compile the following lines,part of a program for Pic16f84a, and I
>get in line <2> the
>"Message[302] : Register in operand not in bank 0.  Ensure that bank bits
>are correct".

>and in line <5> a "Warning[202]  : Argument out of range.  Least
>significant bits used".

First the last problem, you can note binary by doing:
       movlw   b'01010101'

I think
       movlw 01010101B might be assembled as hex.

As for the 302 error, it is benign, it is a notification that you should
make sure your bank bits are set properly for those lines.  The assembler
is dumb, it doesn't "know" what the bank bit settings are so it simply
warns you.

If you are confident with your bank settings, include this line in your
program, possibly a header file or just at the top of the code file.
       errorlevel -302

This turns the warning notification on, if you want to be warned about it
elsewhere in your code in case you forget to handle it properly:

       errorlevel +302

I use macros, here is a segment of mine:

bank0   MACRO                   ;macro to select data RAM bank 0
       errorlevel +302
       bcf     STATUS,RP0
       bcf     STATUS,RP1
       ENDM

bank1   MACRO                   ;macro to select data RAM bank 1
       errorlevel -302
       bsf     STATUS,RP0
       bcf     STATUS,RP1
       ENDM

they are called like so:
       bank1
       clrf    trisb
       bank0

Jeff

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\14@133823 by Thomas C. Sefranek

face picon face
Renzo Giurini wrote:

> I try to compile the following lines,part of a program for Pic16f84a,
> and I
> get in line <2> the
> "Message[302] : Register in operand not in bank 0.  Ensure that bank bits
> are correct".

Perfectly correct!
Your setting RP0 does NOT tell the assembler you selected bank 1.

>
>
> and in line <5> a "Warning[202]  : Argument out of range.  Least
> significant bits used".

Again correct!
the form is B'01010101'
Putting a B at the end signals HEX characters

{Quote hidden}

--
 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\14@153228 by Andrew Warren

flavicon
face
Thomas C. Sefranek <.....PICLISTKILLspamspam@spam@mitvma.mit.edu> wrote:

> the form [for binary numbers in MPLAB] is B'01010101'
> Putting a B at the end signals HEX characters

Thomas:

That's only true if your default radix is set to Hexadecimal.  If
it's set to Decimal, 01010101B is a perfectly-acceptable way to
represent a binary number.

-Andy

=== Andrew Warren -- aiwspamKILLspamcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\01\14@161326 by Bob Barr
flavicon
face
On Mon, 14 Jan 2002 12:33:01 -0800, Andrew Warren wrote:

>Thomas C. Sefranek <.....PICLISTKILLspamspam.....mitvma.mit.edu> wrote:
>
>> the form [for binary numbers in MPLAB] is B'01010101'
>> Putting a B at the end signals HEX characters
>
>Thomas:
>
>That's only true if your default radix is set to Hexadecimal.  If
>it's set to Decimal, 01010101B is a perfectly-acceptable way to
>represent a binary number.
>

Excellent! I hadn't realized that.

I've always hated using quotes around binary numbers.


Regards, Bob

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


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