Searching \ for 'persistent PIC16C84 messages' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16C
Search entire site for: 'persistent PIC16C84 messages'.

Truncated match.
PICList Thread
'persistent PIC16C84 messages'
1998\04\16@205520 by MARVIN ANDROID

picon face
Hi everyone,

The following code brings up these two messages all the time (line 86,90). What
am i doing wrong? Im thinking it has to be something obvious (hoping)..

Please help! :-)

Gabes.
BusiTech Software
PS: A side issue - lines 82 and 83 are exactly the same instruction but I
noticed that the hex codes are identical. STATUS has been set to 3 yet both
commands refer to 0x83 which is also STATUS but in bank 1. *sigh* I hate being
a newby..
--------------------------------------------------------------
                   00078
001C                00079 START             ; Beginning of program
                   00080
                   00081   ;set PORTB as inputs
001C 1683           00082   bsf   STATUS, RP0   ;select bank 1
001D 1683           00083   bsf   3, RP0   ;select bank 1
                   00084
001E 3000           00085   movlw 0x00
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
correct.
001F 0086           00086   movwf TRISB
                   00087
                   00088   ;set PORTA as inputs
0020 301F           00089   movlw 0x1F
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
correct.
0021 0085           00090   movwf TRISA
                   00091
0022 1283           00092   bcf   STATUS, RP0   ;select bank 0
                   00093   ;check mode
0023 1A05           00094   btfsc PORTA, RA4T0CK1
                   00095
0024 2806           00096   goto RUN_MODE
0025 2807           00097   goto PROGRAMMING_MODE
                   00098
                   00099   END
--------------------------------------------------------------



____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1

1998\04\17@015259 by Lauri Pirttiaho

picon face
Re:
>The following code brings up these two messages all the time (line 86,90). What
> am i doing wrong? Im thinking it has to be something obvious (hoping)..
...
>Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
> correct.
>001F 0086           00086   movwf TRISB
...

There is nothing wrong since you have correctly chosen the bank previously.
The message is just a warning in the case you forgot to do it.

>PS: A side issue - lines 82 and 83 are exactly the same instruction but I
> noticed that the hex codes are identical. STATUS has been set to 3 yet both
> commands refer to 0x83 which is also STATUS but in bank 1. *sigh* I hate being
> a newby..

The binary code for bsf is 01 0110 1XXX XXXX where XXX XXXX is the address
in the register file. The eighth bit is ignored when the opcode is
assembled and in the case it is significant you have to ensure
that it is writtein in Status,RP0 (what the Message[302] instructs
you to do.)

-- Lauri

---
<a href="http://www.ee.oulu.fi/~lapi/">For more info.</a>

1998\04\17@045906 by Marco DI LEO

flavicon
face
MARVIN ANDROID wrote:
>
> Hi everyone,
>
> The following code brings up these two messages all the time (line 86,90).
What
>  am i doing wrong? Im thinking it has to be something obvious (hoping)..

Nothing wrong, this is just the way MPASM uses to remind you that the
registers (TRISA and TRISB) you are accessing are not located in bank 0
and you have to set RP0 accordingly (seems you have done that).
To get rid of the warnings you can mask off the high bit of the bank 1
register address as in:

       movwf   TRISB & 0x7f

or, better:

       movwf   TRISB ^ 0x80

The latter is preferable because prevents you to use a bank 0 register
thinking is located  on bank 1 (this will give you the 302 warning).

> PS: A side issue - lines 82 and 83 are exactly the same instruction but I
>  noticed that the hex codes are identical. STATUS has been set to 3 yet both
>  commands refer to 0x83 which is also STATUS but in bank 1. *sigh* I hate
being
>  a newby..

The coding is the same because there is only 7 bit for the address
operand in the instruction. That's the reason wy the RP0 bit exists.

Ciao
 Marco

----
Marco DI LEO                  email: spam_OUTm.dileoTakeThisOuTspamsistinf.it
Sistemi Informativi S.p.A.    tel:   +39 6 50292 300
V. Elio Vittorini, 129        fax:   +39 6 5015991
I-00144 Roma
Italy

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