Triggering a slave target with parallel port

Hi, I need to syncronize two targets running xPC Target. I use a Master/Slave approach. I read I have to set the slave model to run on IRQ7 (coming from parallel port) instead of using the Real Time Clock of the machine.
I correctly did this but...how can I send the clock signal from the master target? I read I need to send a square waveform on pin 10 of the parallel port in order to generate the interrupt on the slave. But I am only able to find blocks writing on data pins (1-8) and control pins of the parallel port. Pin 10 is a status pin, how can I write on this pin from the master target?
Thanks

 Risposta accettata

Walter Roberson
Walter Roberson il 14 Ott 2013
Modificato: Walter Roberson il 14 Ott 2013
To confirm: you need to send your square wave on the nACK pin? You cannot do that: ACK is input only.
Bit 4 of the control port (see page 7 of http://retired.beyondlogic.org/spp/parallel.pdf) enables the host to generate an IRQ when an edge is seen on the nACK pin; see page 12 of that document.
Does your slave need an edge to trigger a particular action, or does it need a full clock? If it needs an edge then you could potentially use the strobe (pin 1) or nSelect (pin 17). If it needs a full clock then you have a problem as parallel ports are not designed for shared clocks: they are designed for asynch work with multiple inputs per asynch cycle.
Clock sync is better done with an D/A convertor that offers a shared clock. Or, I suppose, perhaps one of the old BISYNC connectors (if you can still find one.)

2 Commenti

I need to syncronize 2 targets machines. Master machine executes on its Real Time Clock ticks while slave machine executes on interrupts coming from master machine. So properly I need to send a clock, not only an edge to trigger a particular action.
I read that I have to use pin 10 here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/162630 Here it's indicated to send a square waveform on pin 10 in order to generating the interrupt on the slave computer.
From the document you suggested, I read that pin 10 is a status pin and it's only possible for the computer to READ from this pin 10. But I suppose that if it's possible to read, it means that the other machine (for example the printer) is able to write on pin 10. I don't have one PC and one printer, I have 2 PCs so one read on pin 10 and consequently one would have to write on it.
The thread says in part,
The parallel port ACK input (pin 10) triggers an interrupt
on the rising edge of the input signal. You can test this
interrupt by connecting a square wave signal generator set
to produce a 0-5 volt (TTL level) signal.
That square wave suggestion is only given for testing purposes, to demonstrate that interrupts will be taken on the rising edge. The discussion is about getting the slave to read data sent from the master, not on sending a clock signal. The slave would, for the purposes of the thread, be running independently, doing whatever it needed to do, and then when it saw the rising edge on the nACK pin for it, it would trigger an interrupt that would run at whatever the target's instruction rate was, running a code routine to deal with the interrupt.
You indicate "So properly I need to send a clock", but that would seem to contradict "while slave machine executes on interrupts coming from master machine". Interrupt triggering only needs an edge generated somehow, not a full clock. For example you could tie the strobe output (pin 1) of the host to the nACK input of the slave (you'd have to double-check whether you need to invert the strobe along the way.)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by