Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

switch input to paralel port

Status
Not open for further replies.

vlad777

Member
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.
 
Nop. But something like that is what first came to my mind.
I didnt know how to call it so I didnt search it on the net.
Because of this I also tried to use a potentiometer as an input.
When I turn the thing fast enough I get less glitches maybe even
a clean transition.But when I turn the thing slovely until I hit
special voltage level then I get continualy changeing input.
This also happens when I touch the unconected base of the
transistor that is conected to the port.
(When I connect the base to the ground with a resistor then nothing
happens when i touch it)
I am guessing this is because of interference.

How do you fight this?
Anyway on wikipedia I saw a circuit that might satisfie me.
Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top