Searching \ for '[PIC]: Option reg' 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/devices.htm?key=pic
Search entire site for: 'Option reg'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Option reg'
2001\07\27@124349 by zantos

flavicon
face
RE: PIC16F84A
Can someone advise me why I get

"Warning[224] A:\TEST.ASM 77 : Use of this instruction is not recommended."

when I do this
movlw b'00000000'
option

What should I be using?

TIA

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@125419 by Quentin

flavicon
face
Option is an instruction in the older PIC's to set the Option register.
It is not used anymore.
You should now load the register:
movlw b'00000000'
movwf OPTION_REG        ;if you use the pic6f84a.inc file.

Not sure about the 'F84, but you might have to set to bank1 as well to
do it.

Quentin

zantos wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@140540 by James Paul

flavicon
face
zantos,

It's just telling you that you shouldn't use the 'OPTION'
instruction since on all modern PIC's, the option register
is directly addressable.   You're not going to harm anything
by using the option instruction, but future PIC's may not support
it.  So by getting used to not using it now, you'll be covered in
the future.

                                              Regards,

                                                 Jim



On Fri, 27 July 2001, zantos wrote:

{Quote hidden}

spam_OUTjimTakeThisOuTspamjpes.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@142500 by zantos

flavicon
face
RE: 16F84A

BTW I have include "p16F84A.inc"

Thank you all your input...
I tried this...

movlw b'00000000'
movwf OPTION_reg

and I get this "Register in operand not in bank 0.  Ensure that bank bits
are correct."

So I did this....
bsf 03,5
movlw b'00000000'
movwf OPTION_reg
bcf 03,5

and I still get this
Register in operand not in bank 0.  Ensure that bank bits are correct.

am I missing something?
any pointers appreciated..
TIA


{Original Message removed}

2001\07\27@153936 by Quentin

flavicon
face
Zantos
That is just an iritating warning to tell you that the register is in
Bank1. I would not recommend it now, as you are still learning PIC's,
but later on once you are sure you are selecting the correct banks, you
can put in:
ERRORLEVEL -302
at the top of your code to switch this message off.

Also, since you are using the .inc file, you can use:
bsf status, rp0
and
bcf status,rp0
to select and deselect Bank1.

Quentin

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@161524 by Bob Barr

picon face
Quentin wrote:
>Zantos
>That is just an iritating warning to tell you that the register is in
>Bank1. I would not recommend it now, as you are still learning PIC's,
>but later on once you are sure you are selecting the correct banks, you
>can put in:
>ERRORLEVEL -302
>at the top of your code to switch this message off.
>

Rather than turning this warning off globally, I'd suggest switching it it
on and off as you switch banks.

Having the warning active will catch inadvertent operations with alternate
bank registers.

I try to avoid all warnings (if at all possible). This way I don't have to
'read past' warnings that I *know* are bogus. It's just too easy to miss a
new warning in the midst of a bunch that you've seen dozens of times before.
(Please don't ask how I know this. :=) It was a long and painful lesson. A
real 'Duh!' on my part.)

   .
   .
   bsf    STATUS, RP0    ; alternate register bank
   ERRORLEVEL -302
   .
   do any alternate bank register ops, warnings are supressed
   .
   bcf    STATUS, RP0    ; back to normal bank
   ERRORLEVEL +302
   .
   .


Just my $0.02, Bob



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@172503 by Quentin

flavicon
face
Bob Barr wrote:

>
> Just my $0.02, Bob
And a $0.02 that is worth a lot more. Thanks Bob, one of those tips that
is so obvious, that you over look its usefulness. I'm OK with the bank
select, but this could be very helpful with page select.

Quentin

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@180223 by Jeff DeMaagd

flavicon
face
----- Original Message -----
From: Quentin <.....qscKILLspamspam@spam@ICON.CO.ZA>


> Bob Barr wrote:
>
> >
> > Just my $0.02, Bob

> And a $0.02 that is worth a lot more. Thanks Bob, one of those tips that
> is so obvious, that you over look its usefulness. I'm OK with the bank
> select, but this could be very helpful with page select.

I agree.

Bob, the info on ERRORLEVEL -302 and ERRORLEVEL +302 is very, very handy.
The ability to selectively remove warnings on known good code is a very good
way to avoid trouble with other code.  I've done the same thing but usually
I haven't taken too much damage from overlooking page select problems.

Thanks!

Jeff

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@180646 by Olin Lathrop

face picon face
> option
>
> What should I be using?

I don't know about the 16F84A in particular, but the OPTION instruction is
being obsoleted on many of the newer parts.  The new way to do this is:

 movwf  option_reg


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\27@182800 by Barry Gershenfeld

picon face
>Bob, the info on ERRORLEVEL -302 and ERRORLEVEL +302 is very, very handy.
>The ability to selectively remove warnings on known good code is a very good
>way to avoid trouble with other code.  ...
>Jeff

I'll add my thanks as well; I didn't realize you could turn the
error reporting back on with the "+".   Though if I ever
do assembler again I might try the "xor" trick.

I also wanted to point out that in zantos' second post I see
what I believe to be the first ever recorded instance of
the page select warning actually helping somebody.

:) Barry

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\28@040125 by zantos

flavicon
face
I hear you all ... great many thanks. Saved me many hours of chasing my
tail. Just wondered how many other gotcha ahead???

{Original Message removed}

2001\07\28@052820 by Quentin

flavicon
face
Zantos, there are a few others. Go here:
www.piclist.com/techref/piclist/begin.htm
and work yourself through all the links.

Quentin

--
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 2001 , 2002 only
- Today
- New search...