Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 22nd February 2008, 03:16 AM   (permalink)
Default switch input to paralel port

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.
vlad777 is offline  
Old 22nd February 2008, 12:55 PM   (permalink)
Default

Have you not heard of 'contact bounce'?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 22nd February 2008, 05:31 PM   (permalink)
Default

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.
vlad777 is offline  
Old 22nd February 2008, 06:04 PM   (permalink)
Default

Quote:
Originally Posted by vlad777
How do you fight this?
Anyway on wikipedia I saw a circuit that might satisfie me.
Thanks.
Once you knew what it was called, it's easy to find information on it!
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 10:49 PM
Output = Input - Problems adamthole Micro Controllers 20 24th April 2007 05:09 AM
Reed Switch kid Datasheet/Parts Requests 1 18th February 2006 02:52 AM
1 port with multi input and output function yce_kelvin Micro Controllers 1 2nd July 2004 04:06 PM
Help with AND gate Switching TheFox Electronic Projects Design/Ideas/Reviews 4 18th September 2002 06:43 PM



All times are GMT. The time now is 06:53 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker