Osccal help - PIC

Jan 26, 2004 6 Replies

Hi,



I'm getting a compile message [302] saying that:



'Register in operand not in bank 0. Ensure that bank bits are correct.'



BSF STATUS, RP0 ; Bank 1 CALL 3FFh ; Get Calibration Value MOVWF OSCCAL ; Store Value BCF STATUS, RP0 ; Bank 0



I'm using a 12F629 PIC, and these lines of code are straight out of the data sheet page 54



Could someone please point out where I'm going wrong


Thanks


--dave news001@nospam.org.uk

It's a warning message. Very annoying. If you're sure you have the bank setup right, ignore it.

Yes very annoying, it's about time microchip let you disable that warning.

I'll bet you are using MPLAB IDE for an assembler. It's set up to give you a 302 error if there is a _potential_ for pointing to a register in the wrong bank. To make it go away, put this just after the include file statement:

errorlevel -302

Now you won't see it anymore. It'll be up to YOU to make sure you are in the correct bank. Also see "bankselect" in the help file.

Regards, Charlie If God hadn't intended us to eat animals, He wouldn't have made them out of MEAT! - John Cleese

I know nothing much about this system, but I assume the BSF sets the bank. After the CALL 3ffh who knows what bank is set, assuming whatever is at 3ffh is a subroutine.

Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. USE worldnet address!

In that processor it's just supposed to be a return-literal-in-w retlw xxx, where xxx is is a constant returned in the w register (accumulator).

The message is just a stupid warning.

Note that if the retlw instruction is accidentally erased, it will generally cause unpleasant results.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

In message , Dave expounds

Thanks for the replies gentlemen I thought I was doing something silly:)

--dave news001@nospam.org.uk

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required