gnupic: Thread: What do this errors mean ?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: What do this errors mean ?
From: Pupeno ####@####.####
Date: 8 Feb 2004 21:25:03 -0000
Message-Id: <200402081753.40112.pupeno@pupeno.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As you already know, I'm a newbie... trying to learn with on line tutorials... 
using gpasm I've got this Messages:
test.asm:14:Message [302] Register in operand not in bank 0. Ensure bank bits 
are correct.
test.asm:15:Message [302] Register in operand not in bank 0. Ensure bank bits 
are correct.
What do they exactly mean ?
The lines in question are:
        movwf   TRISB
        movwf   TRISA
and the whole program can be found here 
http://www.winpicprog.co.uk/pic_tutorial1.htm

Do you recomend a better tutorial ?

Thank you!!! :)
- -- 
Pupeno: ####@####.####
http://www.pupeno.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAJqHTtCepaMf3unIRAg9FAJ9fbE88DKHlmpGpclWcSn0xV+SBUACePBYt
+7pu6QILzL4EfMa9rMNCPNk=
=6jR6
-----END PGP SIGNATURE-----
Subject: Re: What do this errors mean ?
From: James Cameron ####@####.####
Date: 8 Feb 2004 22:52:15 -0000
Message-Id: <20040208214848.GA27117@us.netrek.org>

On Sun, Feb 08, 2004 at 05:53:37PM -0300, Pupeno wrote:
> test.asm:14:Message [302] Register in operand not in bank 0. Ensure bank bits 
> are correct.

If you know the code is correct, I've learned that this message is just 
a warning and can be ignored.  It is pointing out that you are accessing 
TRISB and TRISA, that would normally require a bank switch.

There's a way to satisfy the warning, but I don't recall what it is.

-- 
James Cameron    ####@####.####     http://quozl.netrek.org/
Subject: Re: What do this errors mean ?
From: Michiel Boerman ####@####.####
Date: 8 Feb 2004 23:10:06 -0000
Message-Id: <9E76AC14-5A87-11D8-BBF3-000502D16926@id5r.nl>

if you look around a bit you will sometimes find this line in sample 
code:

     ERRORLEVEL -224        ;  supress annoying message because of tris

which shows you are not the only one getting this error message.
You can use this line in your own code if the message bothers you.

michiel


On 8-feb-04, at 22:48, James Cameron wrote:

> On Sun, Feb 08, 2004 at 05:53:37PM -0300, Pupeno wrote:
>> test.asm:14:Message [302] Register in operand not in bank 0. Ensure 
>> bank bits
>> are correct.
>
> If you know the code is correct, I've learned that this message is just
> a warning and can be ignored.  It is pointing out that you are 
> accessing
> TRISB and TRISA, that would normally require a bank switch.
>
> There's a way to satisfy the warning, but I don't recall what it is.
>
> -- 
> James Cameron    ####@####.####     
> http://quozl.netrek.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>

Subject: Re: What do this errors mean ?
From: Scott Dattalo ####@####.####
Date: 9 Feb 2004 00:36:55 -0000
Message-Id: <Pine.LNX.4.44.0402081554090.23387-100000@ruckus.brouhaha.com>

On Sun, 8 Feb 2004, Pupeno wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> As you already know, I'm a newbie... trying to learn with on line tutorials... 
> using gpasm I've got this Messages:
> test.asm:14:Message [302] Register in operand not in bank 0. Ensure bank bits 
> are correct.
> test.asm:15:Message [302] Register in operand not in bank 0. Ensure bank bits 
> are correct.
> What do they exactly mean ?
> The lines in question are:
>         movwf   TRISB
>         movwf   TRISA

As others have said, this is just a warning. Another way to disable them 
is by:


    movwf  TRISA ^ 0x80

(Andy Warren is the originator of this idea). The reason gpasm is
complaining is because the address of the TRIS registers is beyond 0x7f.  
The movwf instruction (and all register addressing instructions) can only
accommodate 7-bit addresses. The 8'th bit (and 9'th on some processors) is 
RP0 bit, the register page 0, and is found in the status registers. You'll 
have to manually manipulate register page bits to select registers in the 
other banks. Many people will suggest using the BANKSEL macros to do this. 
I prefer to do it manually. Also, I never inhibit the warning.

The reason to use an xor (instead of say an AND 0x7f) is that if you 
mistaken a bank 0 register to be a bank 1 register, the warning that you 
hate right now will turn out to be your friend. E.g.:

   MOVWF   PORTA ^ 0x80   ; this will cause a warning.

Scott




[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.