Searching \ for 'Read TRISx register?' 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/ubicom/devices.htm?key=sx
Search entire site for: 'Read TRISx register?'.

Truncated match.
PICList Thread
'Read TRISx register?'
1999\11\14@174939 by erik

flavicon
face
Here's an easy one.
I thought I heard or read somewhere that the TRIS registers were write
only.  I can't seem to find this information in the data sheets
anywhere.

So, can I read the TRIS registeres?

Thanks,
Erik

1999\11\14@225141 by paulb

flavicon
face
Erik wrote:

> Here's an easy one.
> I thought I heard or read somewhere that the TRIS registers were write
> only.  I can't seem to find this information in the data sheets
> anywhere.

 Hmmm.  It's there.  On the 16C5x and the derivative 12C5xx series,
TRIS is indeed write-only.  On the "later" devices, such as the 16F84
and 16C7x(x), the TRISx register appears banked "behind" the
corresponding PORTx register - i.e., the address is the same, but you
must set the RP0 bit in Status to access it *instead* of the port.

 It may also be accessed through the INDirect register at an address
$80 higher.

 If you only want to write TRISx, then despite the peculiar warnings in
the documentation and assembler, the original TRIS (and similarly,
OPTION for the option register) instructions as used with the 16C5x
devices remain the most efficient (and therefore, preferred!) method of
access.

 Further, *some* people are suspicious that the TRISx registers, like
the PORT register, may be susceptible to glitches (from spikes etc.) due
to its close proximity to the output devices, and that therefore read-
modify-write instructions using TRISx as a register may be a Bad Idea,
so that writing with set patterns (either as a register, or using the
special TRIS instruction without bank switching) is safest.
--
 Cheers,
       Paul B.

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