Searching \ for 'Logic level on an input 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/ios.htm?key=input
Search entire site for: 'Logic level on an input pin?'.

Truncated match.
PICList Thread
'Logic level on an input pin?'
1999\08\11@154420 by Jim Main

flavicon
face
I want to interrogate a logic level on an input pin to see if it's high or
low.  I'd like to do this over the working voltage of the pic  (2-6V).

Problem is, I dont want to default to either logic level (pulled high or
low), since I'd like to detect indeterminate states as well.

How best to do this?

Jim

---
----------------------------------------------------------------------------
--------------------
Jim Main                                        |   Eastcom Broadcast
Develpments
spam_OUTjim.mainTakeThisOuTspameastcom.co.uk            |   custom hardware and software
                                                       |
http://www.eastcom.co.uk
----------------------------------------------------------------------------
--------------------

1999\08\11@154646 by Harrison Cooper

flavicon
face
A/D input

1999\08\11@160258 by Jim Main

flavicon
face
----- Original Message -----
From: Harrison Cooper <.....hcooperKILLspamspam@spam@ES.COM>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent: 11 August 1999 20:45
Subject: Re: Logic level on an input pin?


> A/D input
>
& use Vdd (2-6V) as Vref?

Jim

1999\08\11@161334 by Adam Davis

flavicon
face
Haven't tried this, but it's an idea...

Use a resister ladder and two pins.  You'll need to have a chip with schotky(sp)
input, and you'll need to know the cutoff voltage for it.  After that, it
shouldn't be too hard to put it together...

But a/d would be the better way to go.

-Adam

Jim Main wrote:
{Quote hidden}

1999\08\11@174930 by paulb

flavicon
face
Adam Davis wrote:

> Use a resister ladder and two pins.  You'll need to have a chip with
> schotky(sp) input, and you'll need to know the cutoff voltage for it.

 Basically, one resistor between two pins.  The second can be an output
that is not otherwise used at the moment of testing (but may have
another output allocation).

 If the input follows the alternate states of the output, it is
connected to a tri-state, if it doesn't it is fixed.  I suspect that is
what was asked for.
--
 Cheers,
       Paul B.

1999\08\11@190939 by Peter van Hoof

flavicon
face
Paul B. wrote:
>   If the input follows the alternate states of the output, it is
> connected to a tri-state, if it doesn't it is fixed.  I suspect that is
> what was asked for.

There is the danger that you will inject a signal in the device under test
Speed will probably also not be great (though better than with an a/d
conversion)

the two resistor ladder with st inputs sounds like a better idea

another option , a 2 comparator window to two input pins

peter

1999\08\11@220845 by Russell McMahon

picon face
If you can't use an A/D and only a single pin is to be used AND you don't
mind a few microseconds response time to switching something like this
should work.

1K (say) from pin to input signal.(could be higher)
Pullup resistor pin to Vcc (either on chip or external) say 100K ish.
Small capacitor pn tto ground.
Use a 100pF in the following example. Time constant with 100K is 10uS.

A true high will show as a high.
A true low will show as a low.

A "float" will be pulled up to high.
If  you make the pin an output. set it low and then make it an input it
will initially read as a low if it floating due to the time taken to charge
the capacitor. However a true high will return to high with negligible time
(time constant of 0.1uS in the above example). A little juggling with RC
sizes and code times may be neded but this should be able to be made quite
reliable.

Procedure.
Default mode is input.
A low read means the input is high.
If a high read.
- switch to output
- set low
-switch to input
- read port
- A low read means a float., a high read means a high.

You canreverse the high/low mthod by using a pulldown instead of a pullup.

regards

               Russell McMahon






{Quote hidden}

--
>--------------------
>Jim Main                                        |   Eastcom Broadcast
>Develpments
>EraseMEjim.mainspam_OUTspamTakeThisOuTeastcom.co.uk            |   custom hardware and software
>                                                        |
>http://www.eastcom.co.uk
>--------------------------------------------------------------------------
--
>--------------------
>

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