Searching \ for 'Picn up the Pace Q2' 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/devices.htm?key=pic
Search entire site for: 'Picn up the Pace Q2'.

Truncated match.
PICList Thread
'Picn up the Pace Q2'
1998\10\26@111229 by enberg

picon face
Looking at the code on page 20 for 74hc165.asm I understand every line
in it except for at the beginning.....

bsf   status,rp0    ;switch to bank 1
bcf   status,rp0    ;switch BACK to bank 1

Huh??

I understand what the statements do (switch memory banks), I'm just
completely lost as to WHY they are even there.

Please, can anyone help me?

1998\10\26@221557 by Heinz Czychun

flavicon
face
Hi Mike,

       Apparently, on the original 16C84, the Option, and TriState ( data
direction registers ) registers (in Memory Bank 1) were not directly
accessable. The OPTION, and TRISx, instructions had to be used to access
these registers.

       On the 16F84s the second bank of registers are accessable by
setting the rp0 bit in the status register. This allows the Option, and
Trisx registers to be accessed directly. Thus making the TRIS, and OPTION
instructions obsolete. These are still supported by the 'F84 but,
presummably can become unsupported in the future.

       BTW, since you've got PIC'n Up the Pace, Easy PIC'n covers these
subtleties very nicely, in the same format.

Regards,
Heinz

At 11:31 AM 10/26/98, Mike Ringenberger wrote:
{Quote hidden}

1998\10\26@224506 by paulb

flavicon
face
Heinz Czychun wrote:

> On the 16F84s the second bank of registers are accessable by setting
> the rp0 bit in the status register.  This allows the Option, and
> Trisx registers to be accessed directly.  Thus making the TRIS, and
> OPTION instructions obsolete.

 Hey!  Whoa there!  I wouldn't say that's true *at all*!!!  Having TRIS
and OPTION registers accessible as such is only useful in terms of
performing reads on them, and by implication, Read-Modify-Write or so-
called "bit" set/ clear functions which are by common assent, just a bit
dicky anyway.

 As I see it, the combination "movlw value; tris portb" is an awful lot
better than "movlw value; bsf status, rp0; movwf portb; bcf status, rp0"
but of course, maybe others see it differently.

> These are still supported by the 'F84 but, presumably can become
> unsupported in the future.

 Presumably, but obviously can *not* become unsupported in the 16F84.

 It's all really a rather amusing pretension to code-transportability
in an environment where code transportability isn't particularly
meaningful.
--
 Cheers,
       Paul B.

1998\10\26@224713 by paulb

flavicon
face
Whoops!  Missed the *most* obvious blunder!

Heinz Czychun wrote:

> Apparently, on the original 16C84, the Option, and TriState ( data
> direction registers ) registers (in Memory Bank 1) were not directly
> accessable. The OPTION, and TRISx, instructions had to be used to
> access these registers.

 Should read "on the original 16C54".
--
 Cheers,
       Paul B.

1998\10\27@064214 by Heinz Czychun
flavicon
face
Hi Paul,

At 2:46 PM 10/27/98, Paul B. Webster VK2BZC wrote:
>Whoops!  Missed the *most* obvious blunder!
>
>Heinz Czychun wrote:
>
>> Apparently, on the original 16C84, the Option, and TriState ( data
>> direction registers ) registers (in Memory Bank 1) were not directly
>> accessable. The OPTION, and TRISx, instructions had to be used to
>> access these registers.
>
>  Should read "on the original 16C54".

       Thanks for keeping me honest. I'm still a bit confused by the
pre'F84 PIC nomenclature. I agree calling the TRIS, and OPTION instructions
obsolete was a bit strong.

Regards,
Heinz

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