The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: Andrew Kohlsmith
Subject: Re: what port to use onthe microchip 16c74
Date: Tue, 14 Jan 2003 23:52:43 -0500
NNTP-Posting-Date: Tue, 14 Jan 2003 23:53:15 EST
Organization: WorldCom Canada Ltd. News Reader Service
> hi, im building a project which is a datalogger for a go kart. one
> part of the circuit has a magnetic sensor and i want to connect this
> to the pic. i tried using portb pin 7 as it has interrupt on change
> but it has not been too sucessfull. a copy of the code im using is
> attached. the code works when i single step it but when i run it, it
> gives me results as if the magnet has passed the sensor many times
> when it has only passed once. i have tried using a schmitt trigger in
> series with the sensor just to get a clean transition, but it made no
> difference to my problem.
Generally you do not want to hook up any external sensor to an interrupt pin
unless you're really cleaning up the signal and can ensure it will never
run outside of what you specify.
I used to use the RBIF to detect line frequency but it would cause no end of
problems if there was significant line noise at the zero crossings. I gave
up and polled it. I'd ignore any change that occured "too fast" to be
real, effectively making a sotware low-pass filter.
I imagine you're getting either false triggering or bouncing of the magnetic
pickup. Schmitt-triggering helps with false triggers but if it's bouncing
you need to basically make a one-shot (in software or hardware) which
prevents the input from being recognized again once it has tripped.
Again, without additional hardware I wouldn't recommend using an interrupt
pin to do this.
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup