I am having this problem.
When i click the switch (mechanical switch)
instead of getting this:
00000000001111111111
I get this:
00000101010101111111
when I successively read changes to bit 5 (mask 32)(pin 12) of the
status port(base+1) of the parallel port. ( LPT1: base=378h)
I dont think anything is ocsilating.
I am guessing that change of voltage on the switch is too slow
and that when it is around 1.7x V , 50Hz interference from the power grid
gets amplified at the base of an input transistor.
I didnt know that the capacitance of a switch is so high, or is it something
else?
I actualy want to measure RPM of a brushless DC motor so when I connect
a hall generator to the port I dont get this problem
(I am guessing because there is a schmitt trigger in it)
but this is only me testing with a magnet in my hand.
I am wondering how the voltage is chaneing when the motor is spinning.
So should I use the schmitt trigger at the input or the interference can be
filtered out diferently?
And I am also very puzzled that a switch is so slow.
Many thanks.