Searching \ for ' [PIC] Digital values and rising falling' 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/devices.htm?key=pic
Search entire site for: 'Digital values and rising falling'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] Digital values and rising falling '
2001\03\06@115031 by Nick Torenvliet

flavicon
face
I am trying to sample a relatively slow signal to get
some rought idea of its frequency and so I thought
that rather than use the AD ports on a PIC16F877 I
might change the analog signal to digital
using a voltage comparator, and then I could read
the signal values at one of the PIC's digital IO pins.

Sounds great! I am just wondering what will happen
on the off chance(or not so off) that I go to read
the IO pin while it is going through a signal
transition.  i.e what happens if the pin is rising
or falling and I read from it.



Nick Torenvliet
FieldStone Solutions
62 Longwood Road South
Hamilton Ontario
L8S 1S5

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\03\06@180532 by James Cameron

flavicon
face
On Tue, Mar 06, 2001 at 11:53:40AM -0500, Nick Torenvliet wrote:
> Sounds great! I am just wondering what will happen
> on the off chance(or not so off) that I go to read
> the IO pin while it is going through a signal
> transition.  i.e what happens if the pin is rising
> or falling and I read from it.

You'll get a one or a zero.  If you look fast enough, you might even
see a mix; I'm sure I've seen that once or twice.  You can calculate
from the clock frequency how frequently you will be sampling the input,
and then based on the low and high input voltage specifications of the
pin you can calculate what slope of line might cause this behaviour.

If you build your comparator with hysteresis, it won't oscillate at the
switching point.  It will move fairly fast, and so the chances are that
you won't have to worry; it will be at Vdd or Vss, and rarely between.

--
James Cameron    .....quozlKILLspamspam@spam@us.netrek.org     http://quozl.netrek.org/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\03\06@182626 by Andrew Warren

flavicon
face
James Cameron <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU> wrote:

Nick Torenvliet wrote:

> I am just wondering what will happen on the off chance(or not so
> off) that I go to read the IO pin while it is going through a
> signal transition.  i.e what happens if the pin is rising or falling
> and I read from it.

and James Cameron <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU> replied:

> You'll get a one or a zero.  If you look fast enough, you might
> even see a mix; I'm sure I've seen that once or twice.

   I'm sure you haven't.  The CPU doesn't read the voltage on the
   I/O pin directly; there's at least one clocked buffer between the
   pin and the PORTx register, so the value that the CPU reads is
   guaranteed to be stable during the read cycle.

   -Andy


=== Andrew Warren --- aiwspamspam_OUTcypress.com
=== IPD Systems Engineering, CYSD
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\03\06@202006 by James Cameron

flavicon
face
On Tue, Mar 06, 2001 at 03:20:45PM -0800, Andrew Warren wrote:
> and James Cameron <KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU> replied:
> > You'll get a one or a zero.  If you look fast enough, you might
> > even see a mix; I'm sure I've seen that once or twice.
>
>     I'm sure you haven't.  The CPU doesn't read the voltage on the
>     I/O pin directly; there's at least one clocked buffer between the
>     pin and the PORTx register, so the value that the CPU reads is
>     guaranteed to be stable during the read cycle.

Yeah, sorry, I was inaccurate.  I mean if you keep reading, many times,
you may see a mix of ones and zeros if the signal is oscillating or
moving too slowly.  Each bit is being clocked in on the Q2 cycle of
each reading instruction.

--
James Cameron    RemoveMEquozlTakeThisOuTspamus.netrek.org     http://quozl.netrek.org/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body


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