Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.
@mark_s
I would add that moving the reed switches a few inches away but leaving all the wiring as is would likely cause the reed switches to stop functioning but that is OK as it would allow you to determine if mark_s's theory holds true.
If you still have false trigering then it was because of either the magnetic coupling or possibly vibration.
At least that is what it seems you were getting at with your suggestion (or am I missing your point Mark?)
@richard
Here is how I devised a software debounce that would not block the rest of my main code loop
Code:
Main:
if swflag = 1 and sw1=open then swflg = 0 '(sw debounce) clear swflg only when switch released
if swflag = 0 and sw1=closed then 'sw1 button detected and valid
swflag = 1 'set flag that switch has been closed
(code goes here that you wanted the switch to do)
endif
(more main code loop goes here)
GOTO Main
it requires the swflag = 0 before it will acknowledge the sw1 is pressed. Other wise the switch will be ignored.
the only way for swflag to return to 0 is for you to release sw1
Last edited by Heckler; - 21st February 2016 at 01:54.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Bookmarks