Re: [piclist] Bank switching question


Jul 22, 2003

 


----------------------------

#1895 Jul 22, 2003

Hi all,

I'm working with a 16F628 but this question applies to most chips.

I know that when initializing or setting bits in special function registers,

one must switch to the appropriate bank. Is a bank switch required to read

or test the condition of bits in these registers?

TIA



Regards,

Stephen D. Barnes



----------------------------

#1900 Jul 22, 2003

I believe you can use indirect addressing to accomplish this, although

to date I have just switched pages to get to the address I want then

switch back. Pretty simple, just set bit of R/W-0 in the status

register to select the bank, do your deal, then clear it so you're back

to bank 0 (or select the bank you came from). Of course YMMV and

others here will have a better explaination from which I will learn

(what a CYA).



Regards, John.





--- "Stephen D. Barnes" stephendbarnes@...> wrote: > Hi all,

> I'm working with a 16F628 but this question applies to most chips.

> I know that when initializing or setting bits in special function

> registers,

> one must switch to the appropriate bank. Is a bank switch required to

> read

> or test the condition of bits in these registers?

> TIA

>

> Regards,

> Stephen D. Barnes

>

>

>





---------------

Do you Yahoo!?

Yahoo! SiteBuilder - Free, easy-to-use web site design software

sitebuilder.yahoo.com



----------------------------

#1901 Jul 22, 2003

Hi Stephan,Yes, the various SFR bits are allocated to specificpages and you must switch to the specific page using the PS bits before you canaccess (read and/or write) the bits on that page, that's unless the registerhappens to be mapped into multiple SFR pages. Scott----- Original Message -----From:Stephen D. BarnesTo: piclistSent: Tuesday, July 22, 2003 1:18PMSubject: [piclist] Bank switchingquestion

Hi all,I'm working with a 16F628 but this questionapplies to most chips.I know that when initializing or setting bits inspecial function registers,one must switch to the appropriate bank. Is abank switch required to reador test the condition of bits in theseregisters?TIA

Regards,Stephen D. Barnes



tounsubscribe, go to www.yahoogroups.com and followthe instructions

Your use of Yahoo! Groups is subject to theYahoo! Terms of Service.


S
e
n
i
o
r
T
u
b
e
.
o
r
g