16F877 RA4 pin read problem

Started by jasujonas March 1, 2004
Hello,

I use PORTA as digital outputs, but in some situations I need to read
current value on PORTA register, but allways get RA4 as 0 (even when
RA4 is written 1). Other bits, except RA4 is read correctly.
Can someone tell me where is the problem?

Many thanks,
Jonas



In a message dated 3/1/2004 3:57:59 PM Eastern Standard Time, j...@yahoo.com writes:


I use PORTA as digital outputs, but in some situations I need to read
current value on PORTA register, but allways get RA4 as 0 (even when
RA4 is written 1). Other bits, except RA4 is read correctly.
Can someone tell me where is the problem?



RA4 is an open collector port.

Sid



RA4 is special.  It must be externally pulled up, and can only be used to pull down a signal.  It cannot drive the line high.
----- Original Message -----
From: jasujonas
To: p...@yahoogroups.com
Sent: Monday, March 01, 2004 2:54 PM
Subject: [piclist] 16F877 RA4 pin read problem

Hello,

I use PORTA as digital outputs, but in some situations I need to read
current value on PORTA register, but allways get RA4 as 0 (even when
RA4 is written 1). Other bits, except RA4 is read correctly.
Can someone tell me where is the problem?

Many thanks,
Jonas



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

Thank you. A pull-up resistor solves the problem.

Jonas --- In , Newzed@a... wrote:
> In a message dated 3/1/2004 3:57:59 PM Eastern Standard Time,
> jasujonas@y... writes: > > I use PORTA as digital outputs, but in some situations I need to
read
> > current value on PORTA register, but allways get RA4 as 0 (even
when
> > RA4 is written 1). Other bits, except RA4 is read correctly.
> > Can someone tell me where is the problem?
> >
> >
>
> RA4 is an open collector port.
>
> Sid




Can you tell me what you were trying to do with PORTA.4? Were you trying to read something?

I am trying to use the same port as a Schmitt Trigger. The data sheet says it is Schmitt trigger input?! Does that mean it has a Schmitt trigger built into it? Or is it where the output of a Schmitt Trigger is fed in?

Thanks

Randy

----- Original Message -----
From: "jasujonas"
Date: Tue, 02 Mar 2004 08:08:37 -0000
To: p...@yahoogroups.com
Subject: [piclist] Re: 16F877 RA4 pin read problem

Thank you. A pull-up resistor solves the problem.

Jonas--- In p...@yahoogroups.com, Newzed@a... wrote:
> In a message dated 3/1/2004 3:57:59 PM Eastern Standard Time,
> jasujonas@y... writes:> > I use PORTA as digital outputs, but in some situations I need to
read
> > current value on PORTA register, but allways get RA4 as 0 (even
when
> > RA4 is written 1). Other bits, except RA4 is read correctly.
> > Can someone tell me where is the problem?
> >
> >
>
> RA4 is an open collector port.
>
> Sid



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions --

___________________________________________________________
Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup




Schmitt Trigger is built in.

--- randy ram <> wrote:

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

Can you tell me what you were trying to do with PORTA.4? Were you
trying to read something?

I am trying to use the same port as a Schmitt Trigger. The data sheet
says it is Schmitt trigger input?! Does that mean it has a Schmitt
trigger built into it? Or is it where the output of a Schmitt Trigger
is fed in?

Thanks

Randy

----- Original Message -----
From: "jasujonas"
Date: Tue, 02 Mar 2004 08:08:37 -0000
To:
Subject: [piclist] Re: 16F877 RA4 pin read problem

Thank you. A pull-up resistor solves the problem.

Jonas --- In , Newzed@a... wrote:
> In a message dated 3/1/2004 3:57:59 PM Eastern Standard Time,
> jasujonas@y... writes: > > I use PORTA as digital outputs, but in some situations I need to
read
> > current value on PORTA register, but allways get RA4 as 0 (even
when
> > RA4 is written 1). Other bits, except RA4 is read correctly.
> > Can someone tell me where is the problem?
> >
> >
>
> RA4 is an open collector port.
>
> Sid
to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions --
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
---------------------------------
Yahoo! Groups Links

To
=====
My software has no bugs. Only undocumented features.

__________________________________



Thanks Chad.

Is there anything else I have to do, to work as a Schmitt Trigger? How will set that PORTA.4 ? Do I just leave it as analog? And will it need a pull up resistor?



----- Original Message -----
From: "randy ram"
Date: Tue, 02 Mar 2004 09:45:04 -0500
To: p...@yahoogroups.com
Subject: Re: [piclist] Re: 16F877 RA4 pin read problem

Can you tell me what you were trying to do with PORTA.4? Were you trying to read something?

I am trying to use the same port as a Schmitt Trigger. The data sheet says it is Schmitt trigger input?! Does that mean it has a Schmitt trigger built into it? Or is it where the output of a Schmitt Trigger is fed in?

Thanks

Randy

----- Original Message -----
From: "jasujonas"
Date: Tue, 02 Mar 2004 08:08:37 -0000
To: p...@yahoogroups.com
Subject: [piclist] Re: 16F877 RA4 pin read problem

Thank you. A pull-up resistor solves the problem.

Jonas--- In p...@yahoogroups.com, Newzed@a... wrote:
> In a message dated 3/1/2004 3:57:59 PM Eastern Standard Time,
> jasujonas@y... writes:> > I use PORTA as digital outputs, but in some situations I need to
read
> > current value on PORTA register, but allways get RA4 as 0 (even
when
> > RA4 is written 1). Other bits, except RA4 is read correctly.
> > Can someone tell me where is the problem?
> >
> >
>
> RA4 is an open collector port.
>
> Sid



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions--

___________________________________________________________
Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions --

___________________________________________________________
Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup




A Schmitt Trigger an interface digital circuitry. You want the port
in digital mode. The Schmitt Trigger cleans up the input signal to
make it easier to incorporate into a digital environment. Look at
http://www.web-ee.com/primers/files/AN-140.pdf and scroll down to
page 3 to see what that means.