Searching \ for 'yet another question..' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=yet+another+question
Search entire site for: 'yet another question..'.

Truncated match.
PICList Thread
'yet another question..'
1998\12\17@043141 by Scott Shidel...

flavicon
face
I downloaded a sample a/d conversion program to do an A/D conversion on
Ch0 of a 16c711, no interrupts...I have a few quesitons on warnings and do
they mean anything significant.
The first one:
Message[302] D:\DAQ 34 : Register in operand not in bank 0.  Ensure that
bank bits are correct.
This occurs while initializing port B as all outputs in the following
code.

       bcf     STATUS, RP0
       clrf    PORTB
       BSF     STATUS, RP0
       movlw   h'0'
       movwf   TRISB  <-------warning points here.

The next ones occur when the A/D is told to start.
Warning[202] D:\DAQ 42 : Argument out of range.Least significant bits used.
Warning[202] D:\DAQ 43 : Argument out of range.Least significant bits used.
Warning[202] D:\DAQ 45 : Argument out of range.Least significant bits used.
in the code:
41      call    SetupDelay      ;setup time >= 10uS.
42      bcf     ADCON0,adif     ;clear int flag
43      bsf     ADCON0,adgo     ;start new conversion
loop
44      btfsc   ADCON0,adif     ;a/d done?
45      goto    update          ;yes then update new value.
46      goto    loop            ;no then keep checking

And the last warning:
is the same as the first in this part of the code..
;InitializeAD, initializes and sets up the A/D hardware.
;Select ch0 to ch3 as analog inputs, fosc/2 and read ch3.
;
InitializeAD
       bsf     STATUS,5        ;select pg1
       movlw   B'00000000'     ;select ch0-ch3...
       movwf   ADCON1          ;as analog inputs<---  Warning here
       bcf     STATUS,5        ;select pg0
       movlw   B'11000001'     ;select:RC,ch0..
       movwf   ADCON0          ;turn on A/D.
       clrf    ADRES           ;clr result reg.
       return

Do I need to worry about this?
If not why does it warn in the first place?


-----------------------------------------------------------------------
               The Pinto Page:  http://www.eng.usf.edu/~shidel
                  Join the Ford Turbo Mailing List!
                 http://www.FindMail.com/list/turbo/
Scott
-71 Pinto, stock 2.3 turbo, 13.67@98, radials
       8.1@85 1/8th mile on slicks
-85 Merkur 13.764@98 on radials&3300lbs! Under $300 in mods!
------------------------------------------------------------------------

1998\12\17@155756 by paulb

flavicon
face
Scott Shidel... wrote:

> I have a few quesitons on warnings and do they mean anything
> significant.

> Message[302] D:\DAQ 34 : Register in operand not in bank 0.  Ensure
> that bank bits are correct.

>         bcf     STATUS, RP0
>         clrf    PORTB
>         BSF     STATUS, RP0
>         movlw   h'0'
>         movwf   TRISB  <-------warning points here.

 You *have* ensured the bank bits are correct; the warning is invalid.
You can 1} ignore it. 2} specify "TRISB^0x80" 3} make macros which set
a value "BANK" as $80 or 0 and BSF/ BCF the RP0 bit so that you can use
"TRISB^BANK" and check whether you have done it right. 4} Set the
errorlevel mask to ignore this problem.

{Quote hidden}

 That doesn't make sense.  Line 45 couldn't have this error but line
44 could - have you mis-typed the quote?  Suspect you have defined adif
and adgo as masks rather than bit positions as they must be for this
construct.

> And the last warning is the same as the first in this part of the
> code..

 Naturally!

> Do I need to worry about this?

 It seems not.

> If not why does it warn in the first place?

 To make sure you have set the bank bits right!
--
 Cheers,
       Paul B.

1998\12\17@190058 by Scott Shidel...

flavicon
face
On Fri, 18 Dec 1998, Paul B. Webster VK2BZC wrote:

> > Message[302] D:\DAQ 34 : Register in operand not in bank 0.  Ensure
> > that bank bits are correct.
>
> >         bcf     STATUS, RP0
> >         clrf    PORTB
> >         BSF     STATUS, RP0
> >         movlw   h'0'
> >         movwf   TRISB  <-------warning points here.
>
>   You *have* ensured the bank bits are correct; the warning is invalid.

Ok..so its basically tellin me I am going to reconfig it, or just plain
config it in this case, and to check and make sure its correct, right?

> You can 1} ignore it.
2} specify "TRISB^0x80"

you mean in the beginning where i define my variables, right? as in
TRISB   equ  0x08
Please forgive me, I am very new to this, and just didnt want to ignore
things I didnt understand:)

{Quote hidden}

you're right...on the line number thing..could you explain what you are
saying a little more...I understand what you mean when you say it has to
be a bit position, but if I defined them as a mask, it was inintentional
since i dont know what a mask is.:)

Thanks again

-----------------------------------------------------------------------
               The Pinto Page:  http://www.eng.usf.edu/~shidel
                  Join the Ford Turbo Mailing List!
                 http://www.FindMail.com/list/turbo/
Scott
-71 Pinto, stock 2.3 turbo, 13.67@98, radials
       8.1@85 1/8th mile on slicks
-85 Merkur 13.764@98 on radials&3300lbs! Under $300 in mods!
------------------------------------------------------------------------

1998\12\20@024006 by paulb

flavicon
face
Scott Shidel wrote:

> Ok..so its basically tellin me I am going to reconfig it, or just
> plain config it in this case, and to check and make sure its correct,
> right?

 It's telling you it's not smart enough to know whether you set the
bank select bit or not.  It *could* easily deduce that because you
*have* set the bank select bit, and you haven't called a subroutine or
passed a label (potential entry to this routine from elsewhere) since
you did so.  But no such intelligence *has* been put in the assembler so
it just says "make sure you set the bank select bit" anyway.

> 2} specify "TRISB^0x80"
> you mean in the beginning where I define my variables, right? as in
> TRISB   equ  0x08

 Well, you could do that, setting TRISB as equal to PORTB, because
that's how the PIC sees it.  But if you specify TRISB as 0x88 to start,
and then write "TRISB^0x80" everywhere you use it, you tell yourself
"this looks funny, make sure you set the bank select bit to match it".

> I understand what you mean when you say it has to be a bit position,
> but if I defined them as a mask, it was inintentional since i dont
> know what a mask is.:)

 Well, ADIF is bit 1, whcih is bit position 1 and that's the value to
which you should have set ADIF in the defines.  But if you wanted to
refer to it by an OR (mask) operation, it would have to be the number 2
corresponding to binary 00000010 .

 On examination, ADIF should be 1 and ADCON0 8 (we are talking 16C71x
are we not?).  I really can't figure why one of these is "out of range",
but for sure the second argument of the bsf/ bcf/ btf instruction must
be in the range of 0 to 7 and I'll bet you have specified some funny
values for ADIF or ADGO.
--
 Cheers,
       Paul B.

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