[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remote triggering an Apple II



Ed Eastman wrote:
Kevin Greene wrote:

What purpose does the resistor serve? I know I've shorted those switch and +5V pins with a wire for testing and I seem to remember it worked fine without damaging anything that I noticed (this was on a II+).

Michael J. Mahon wrote:

+5v >----------+
                 |-  Switch
PB0 >----------+
               \  220 ohms
Gnd >----------+


Kevin:
The resistor charges and discharges the input.

This resistor is to pull the paddle to a definate low potential or zero volts when the switch is inactive. If you only have the switch and 5V the input can be left 'floating' and could randomly (or predictably) be misread as having the switch still applied.

Using a low-value pulldown resistor eliminates any potential uncertainty
about whether the particular model of Apple II you are using has 1) no
internal pulldown, 2) an medium-value internal *pullup*, or 3) an
internal pulldown.

Oh, and personally I'd duplicate this circuit for a second Apple II and use a Double pole/ momentary switch and keep the apple electrons isolated. :)
A1           A2
5v ---   --- 5v
     |-S-|
PBx---   ---PBx
     R   R
0v ---   --- 0v

Isolation is unnecessary if the machine grounds are connected and they
are plugged in in the same house (single utility transformer).  NadaNet
wouldn't work if this were not the case.

And using two switch circuits, even if in a single DP switch, would
cause the machines to sense the level changes out of synchronization.
Mechanical "simultaneity" is far from simultaneous.

Strictly speaking, if sub-millisecond synchronization is required, the
switch should be debounced using a flipflop.

If the PB input is being polled by a 'wait: lda pbx; bpl wait' loop,
then there will be an inherent synchronization uncertainty of 7 cycles.
This uncertainty can be reduced to one cycle by a "binary search" scheme
in which the pushbutton generates a sequence of at least three precisely
timed transitions (or more likely, four, using two pulses).

An alternative approach foregoes the switch (and debouncing) and uses
one of the Apples to generate the synchronization pulse for all the
others.  In this scheme, under program control, the "master" Apple
generates a pulse (or a pair of pulses, see above) using an annunciator
output connected to the "slave" Apple's PBx inputs.  An emitter follower
buffer is recommended, and a low-value pulldown, as suggested earlier.

The low-value pulldown is needed if negative-going transitions are to
be relied upon for timing accuracy, since the resistor must discharge
the wiring to ground.  If you do not wish to rely upon the somewhat
uncertain fall time produced by the pulldown and the total wiring
capacitance, then three pulses should be produced, and only their
rising edges used for synchronization.  (This is not an issue if a
220 ohm pulldown is used and less than 25 feet of wiring.)

The "slave" Apples poll their PB inputs as described (using a method
that produces the required precision).

This is exactly the kind of synchronization that all receiving Apples
connected on a NadaNet do on each packet transmission.  The hardware
required is identical, but, in the case Simon poses, the unidirectional
nature of the communication allows building only half of the interface.

In the case of NadaNet, the synchronization is done to a precision of
one cycle.  BTW, clock drift will cause the machines to drift out of
sync after synchronization unless it is actively maintained by further
synchronization pulses.  In the eight boards in AppleCrate, the measured
drift between the fastest and slowest board was about 25 cycles per
second, so keeping precise sync requires frequent resynchronization.
That translates to about a 10 millisecond drift in 400 seconds.

Since that corresponds to only about 10 feet of sound propagation in
air, CrateSynth doesn't bother to re-sync after its initial synchronization. The average band has a radius of at least 10 feet,
so the drift between voices during a 6-7 minute song is no worse than
the effect of hearing the band from the other side of the room.  ;-)

NadaNet uses a digital phase-lock loop to resynchronize after each
byte sent, or every 94 cycles (this is often enough to tolerate the
one cycle page-crossing delta if the sending machine buffer crosses
a page boundary).

-michael

Parallel computing for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."