| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi everybody, I just installed an old PC that has a sound card(isa with sound card+joystick interface) that i use as an automation device(programmed in Pascal). What it does is read for many hours the joystick port for buttons pressed(a digital sensor connected to a relay closes the circuit and generates the event). The problem is that is generating erratic button presses( with absolutely no aparent reason - it works for days with no problem then it fails) - it might be the sensor who sends the wrong signal..electric contamination...but i believe the problem is on the side of the computer. What should i do - might it be a defective sound blaster compatible card? The sensor is trying to sense a metal(the metal is glued to a 35mm cinema film)..when it senses the metal(very rapidly..in a fraction of a second) it activates a "relay" that closes the circuit for the joystick button generating an event. The code i use to read the bit In pascal: FUNCTION button_1 : Byte; BEGIN button_1 := ((Port[$201] AND $10) XOr $10) ShR 4; END; Isn't there a way to force the event to last longer than the time the relay is active to allow me to diferentiate between real events and hipothetical electricity contamination? Some sort of a timer..everything happens very quickly... Thank You. An help would be welcome. |
|
#2
| |||
| |||
| On Aug 21, 1:25 pm, cyberfreak <AFSem...@gmail.com> wrote: > The problem is that is generating erratic button presses( with > absolutely no aparent > reason - it works for days with no problem then it fails) That could be anything, but it's not your code and I highly doubt it's the sound blaster. It's either the PC getting hot and erratic, or some operating system issue after being up for four days. > Isn't there a way to force the event to last longer than the time > the relay is active to allow me to diferentiate between real events > and hipothetical electricity contamination? Sure, using a loop while looking at the 8253/4 timer to figure out how long things are taking. Look up PCTIM003.TXT for everything you ever wanted to know about using the timer. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.