>
> 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
> .....jim.mainKILLspam.....eastcom.co.uk | custom hardware and software
> |
> http://www.eastcom.co.uk
> ----------------------------------------------------------------------------
> --------------------

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.

>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
>
>---
>--------------------------------------------------------------------------