Shop OBEX P1 Docs P2 Docs Learn Events
Using 'COUNT' to count pulses from Schmitt trigger. — Parallax Forums

Using 'COUNT' to count pulses from Schmitt trigger.

po2lepo2le Posts: 76
edited 2008-08-30 03:08 in BASIC Stamp

My Basic Stamp:· BS2 on homework board, with· PIC16C57C and manual entitled, "What's a microcontroller?"

I'm using the 'COUNT' command to count pulses from a prebuilt·non inverting Schmitt Trigger, 74HC7014, (Phillips semiconductors).· The input to the Schmitt is a two ended pulse with neg. going half and a pos. going half.· The pos. part of the pulse sometimes has a sharp neg.·spike about a fourth of the way through the pulse.· The Schmitt trigger does a fair job of squaring and cleaning the input, except it will follow the sharp neg.·spike and give an extra output pulse.· This extra pulse is counted by the BS2, which results in a faulty count.·
Is there a way to get the BS2 to ignore that short extra spike?

I thought that Schmitt triggers were supposed to ignore spikes and blips, but this one doesn't.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2008-08-29 11:22
    Have you got a de-coupling capacitor ( 0.01 - 0.1) on the power supply pins of your 74hc?

    The stamp is doing what it is supposed to. You have to feed it a predictable, clean pulse string.

    You may need to show us your actual connections and signal levels to make other suggestions.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-08-29 14:39
    Schmitt triggers are great to eliminate small amplitude fluctuations, smaller than their hysteresis band, but beyond that they can't tell the difference between a glitch and a real signal. You said a "prebuilt" Schmitt trigger. There are ways with feedback resistors to increase the hysteresis band, and also ways with small capacitors to filter out short glitches. Can you change the circuit? If the signal is relatively slow, slower than 10 milliseconds pulse widths, say, then there are methods in software to do the COUNTing. That works by testing the signal at least twice in the same state to call it real.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-08-29 23:12
    How about a low-pass filter on the input?
    >-----2K2----+------> to Schmitt
                 |
               1000pF
                 |
                GND
    

    ·
  • po2lepo2le Posts: 76
    edited 2008-08-30 03:08
    Thanks for the information folks.

    The Schmitt trigger is actually six triggers contained within a 14 pin DIP chip. (Hex non-inverting Schmitt trigger 74HC7014, PHILLIPS·SEMICONDUCTORS)· one input, one output for each Schmitt, one pin for pos. supply volts, one for neg. supply volts.· Not much I can do with the internal setup, but I will try using your acvice and information.

    Thanks PO'T
Sign In or Register to comment.