Searching \ for '[PIC]: Bank Register selecting' 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/memory.htm?key=bank
Search entire site for: 'Bank Register selecting'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Bank Register selecting'
2001\02\08@005320 by Tony Jurisic

picon face
Hello,

Say I have just performed an operation on a register in bank 'x' and now
want to do something to a register in bank 'y'. Do I have to change the bank
select register myself or will the chip take care of that for me.

Tony 'lost in a world of pics' Jurisic
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\08@012554 by David Duffy

flavicon
face
Tony wrote:
>Hello,
>
>Say I have just performed an operation on a register in bank 'x' and now
>want to do something to a register in bank 'y'. Do I have to change the bank
>select register myself or will the chip take care of that for me.

Now that would be nice!  Sorry, you have to take care of the bank bits
yourself.
I code in assembler but I'm not certain about the higher level languages.
Regards...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\08@021002 by Andrew Warren

face
flavicon
face
Tony 'lost in a world of pics' Jurisic <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
wrote:

> Say I have just performed an operation on a register in bank 'x'
> and now want to do something to a register in bank 'y'. Do I have
> to change the bank select register myself or will the chip take
> care of that for me.

Tony:

If the PIC took care of it for you, you wouldn't need access to the
bank-select bits.

Look at the opcodes for the instruction set; you'll see that only
seven bits are provided (in the midrange parts) for the register
number.  Parts with more than 128 registers, therefore, need one or
two bits in addition to the seven embedded in each instruction.

Those extra bits come from the bank-select register.  If you're
writing in assembly language, you need to set them appropriately in
software.

Sorry.

-Andy


=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - San Diego, California
=== http://www.geocities.com/SiliconValley/2499

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\08@090536 by Olin Lathrop

face picon face
> Say I have just performed an operation on a register in bank 'x' and now
> want to do something to a register in bank 'y'. Do I have to change the
bank
> select register myself or will the chip take care of that for me.

To current direct register bank setting is controlled by the RP0 and RP1
bits in STATUS.  You have to change these somehow to change banks.

I have an extensive set of macros for managing register banks (and lots of
other stuff).  See http://www.embedinc.com/pic and look at DBANKIF and
related macros in STD.INS.ASPIC.  However, I urge you to first fully
understand the PIC banking architecture and write some code that directly
writes to the bank bits before using the higher level wrapper macros.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\09@174830 by Mike Mansheim

flavicon
face
>>Now that would be nice!  Sorry, you have to take care of the bank bits
>>yourself.
>>I code in assembler but I'm not certain about the higher level languages.
>>Regards...

For what it's worth, C compilers do take care of the bank bits for you.
In fact, the CCS compiler even watches your inline assembly code and
manipulates the bank bits if you access 'C' variables that the compiler
has located on other banks.  Kind of nice, since the compiler is free
to move variables around.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


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