PDA

View Full Version : Using 'COUNT' to count pulses from Schmitt trigger.



po2le
08-29-2008, 12:48 PM
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.

stamptrol
08-29-2008, 06:22 PM
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 Allen
08-29-2008, 09:39 PM
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 (http://www.emesystems.com)

PJ Allen
08-30-2008, 06:12 AM
How about a low-pass filter on the input?

>-----2K2----+------> to Schmitt
|
1000pF
|
GND

·

po2le
08-30-2008, 10:08 AM
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