Searching \ for '[PIC]:tristating a port pin?' 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/ios.htm?key=port
Search entire site for: 'tristating a port pin?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:tristating a port pin?'
2002\08\27@130021 by Micro Eng

picon face
well...searching around, haven't found a way to actually tristate a port
pin?

TRIS is the direction register...but how do you actually set PORTB,3 to be
tristated, then set for an output, and back and forth.

_________________________________________________________________
Join the world s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

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


2002\08\27@130823 by Barry Gershenfeld

face picon face
>well...searching around, haven't found a way to actually tristate a port
>pin?
>
>TRIS is the direction register...but how do you actually set PORTB,3 to be
>tristated, then set for an output, and back and forth.

Well there is a TRIS instruction that they say not to use (because
it is not in every processor), but the reliable way is to
change the bank bits so that you are addressing TRISB instead of PORTB
and then you just change the register bit.

That's in assembler.  If you want to do it in C the compiler manual
will tell you how.  Basically, "input" is the same as "tristate"
...that's in both languages, BTW.

Barry

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


2002\08\27@132105 by Bob Ammerman

picon face
By just changing bit TRISB,3

When TRISB,3 is 1 the output will be tristate (and can be read as an input
if you want to).

When TRISB,0 is 0 the output will be set to whatever is in the PORTB output
register.

Bob Ammerman
RAm Systems


{Original Message removed}

2002\08\27@173906 by Olin Lathrop

face picon face
> TRIS is the direction register...but how do you actually set PORTB,3 to be
> tristated,

   dbankif trisb      ;make sure banks set for access to TRISB
   bsf     tribs, 3   ;set RB3 to high impedence

> then set for an output,

   dbankif trisb      ;make sure banks set for access to TRISB
   bcf     tribs, 3   ;set RB3 to be an output


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\08\30@091012 by Micro Eng

picon face
ahhh...duh!! After reading the posts...and re-reading the databook...I can
see that clearly.

thanks all...


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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