Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Line briefly goes high when writing to other lines individually.

Hi,

I'm using a DIO96 card in a Mac to read in from four external 16 bit timer boxes.

The timers record peoples reaction times to the nearest millisecond to different stimuli (psychology experiment) such as pictures of faces that they do and don't recognise.

The four timer boxes are multiplexed using two output lines to select 1 of the four and the timer value is read in a byte at a time using another line to select the upper or lower byte of the 16 bit time.

There is also a start, stop and reset control lines to the timers from the card. The start and stop signals are active low whilst the reset line is active high. (I did'nt build the timer circuits so I don't know why they use opposite logic.)

Anyway, my program starts the timers running at the same time as presenting a picture of a face and the four participants then hit a 'Recognise' or 'Not Recognised' button on the timer box which stops the timers.

The program continually reads in the timer values and compares it with the last value read in to determine if the timer has stopped.

The problem I have is that for some reason whilst the program is asserting the different control lines to select a multiplexed timer the reset line briefly goes high clearing all the timers to zero!

I’ve checked and double checked that I’m not writing to that line by mistake and that all the lines have been individually initialized earlier in the program and that the iteration parameter is set to one when the write to line function is called.

All these control lines are on PPIB, PortA of the DIO96 card, (that’s CH3 I think, with PPIA Port A = CH0).

Any ideas why it should behave like this? It doesn’t affect the start and stop lines as they are normally high (not asserted).

Do all the control lines of a port go high briefly whilst new values are being written to individual lines of a port until the write is complete?

Thanks,
Dave Gaskell,
Lancaster University.
0 Kudos
Message 1 of 5
(3,589 Views)
Dave,

I would suggest checking the card outputs (particularly the reset line) using an oscilloscope when your timer box is not connected. It sounds more like some inductive interference caused by the fast switching on your 2 address lines. You may need to decouple the reset line with a resistor and/or capacitor.

Jamie
0 Kudos
Message 2 of 5
(3,583 Views)
Thanks Jamie,

When I got hold of a scope and looked at the line it looked like induced spikes from the adjacent signal lines.

A low pass filter of 10k resistor and 0.1uf seems to have cured it.

Dave.
0 Kudos
Message 3 of 5
(3,565 Views)
You have run into one of the "joys" of using hardware emulating the venerable 8255 PIA chip. The only way to get around the "glitch" you are experiencing is to initialize the Digital Ouput port you want to use only once, and then keep it open until your vi is done. Every time you use a digital output vi that initializes the digital output port, all lines are initialized to digital inputs, and have to be reset to your desired logic mode and level. This, unfortunately, creates a very short momentary logic high pulse on all outlet lines in the port. There is a very good article in the Knowledge base on programming with the 8255 PIA, unfortunately, I do not know the exact location; you will have to do a search for it. I remember reading this article years ago, when I first went down the same road you are looking at, and after I got over my disgust, I found the article to be very helpful. If I remember right, there are also some example vi's along with the tutorial.
If you cannot find it, repost here, and I will dig into my archives and see if I can find the copy of the KB I downloaded.

Good luck,

Dave
0 Kudos
Message 4 of 5
(3,562 Views)
Thanks, I was aware of this and if you read my original message I stated that:

"all the lines have been individually initialized earlier in the program and that the iteration parameter is set to one when the write to line function is called (thereafter)."

You say "emulating the 8255", why emulating? Is it not a real 8255 on the DIO96 I/O card?

Any way, the problem seemed to have been caused by inductive pick up of adjacent signal lines that I seemed to have cured with a low pass filter.

Thanks anyway.

Dave.
0 Kudos
Message 5 of 5
(3,546 Views)