Searching \ for 'Flaky 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: 'Flaky Input pin?'.

Truncated match.
PICList Thread
'Flaky Input pin?'
1996\12\20@181134 by Bruce Bowling

flavicon
face
I am using a 16C56 part to measure pulse widths
(in the 0 to 10 ms range). My problem is that I
am getting unreliable input pin detection within
software. I am driving the pin with a test 50 percent
duty square wave, and the measued pulse is correct most
of the time, but on random occasions the software indicates
that the pulse is slightly longer than it really is.

I am driving the input pin via an 4N25 optocoupler, with
the input pin connected between the collector of the phototransistor
(with the emitter grounded) and a 4.7K pullup resistor.
I believe the software is working correctly, and the problem is
With the hardware implementation.

Do I need any special filtering on input ports to reduce
false triggering? Am is missing something??

- Bruce


--
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------
                Bruce A. Bowling
                Staff Scientist
  Thomas Jefferson National Accelerator Facility
   12000 Jefferson Ave - Newport News, VA 23602
                (804) 249-7240
spam_OUTbowlingTakeThisOuTspamcebaf.gov  http://devserve.cebaf.gov/~bowling
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------

1996\12\21@031623 by fastfwd

face
flavicon
face
Bruce Bowling <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU> wrote:

> I am using a 16C56 part to measure pulse widths (in the 0 to 10 ms
> range). My problem is that I am getting unreliable input pin
> detection within software. I am driving the pin with a test 50
> percent duty square wave, and the measued pulse is correct most of
> the time, but on random occasions the software indicates that the
> pulse is slightly longer than it really is.
> ....
> I believe the software is working correctly, and the problem is
> With the hardware implementation.

Bruce:

Please (1) show the relevant portion of your code, (2) tell us your
PIC's clock frequency and the frequency of your 50% duty-cycle
square wave, (3) describe precisely what "slightly longer" means,
and (4) tell us that you've looked at the incoming signal with an
oscilloscpe ON THE PIC's I/O PIN and have seen nothing but clean,
fast-risetime square-waves there.

-Andy

=== Andrew Warren - fastfwdspamKILLspamix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===

1996\12\21@203159 by Ray Gardiner

flavicon
face
Hi Bruce,

If you are not driving the opto correctly there may be a
variation in the rise time. I would suggest that you check
the data sheets on the 4N25, and ensure that you are getting
the frequency response you expect. 4k7 is a relatively light
load. I would opt for something less maybe 470R, but depends
on the ctr and frequency response characteristics of the opto.

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

{Quote hidden}

Ray Gardiner, Shepparton, Victoria, Australia:  EraseMErayspam_OUTspamTakeThisOuTnetspace.net.au

1996\12\21@214748 by Ray Gardiner

flavicon
face
{Quote hidden}

I just checked the 4N25 data sheets, (had to go to the office anyway).
The motorola data sheets show that with RL=1K the turn off time has a
minimum of ~10us around 3ma led current. but rises either side of that
wheras with RL=100R the minumum off time is 4-5us at a led current of
7 ma or so. And only slightly faster with RL=10R.

So I suggest that you first check the led current is around 7 ma and
then change the pull up to 100R.


Ray Gardiner, Shepparton, Victoria, Australia       rayspamspam_OUTdsp-systems.com
Technical Director DSP Systems               http://www.dsp-systems.com
Private e-mail to:-  @spam@rayKILLspamspamnetspace.net.au

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