git-svn-id: https://svn.salfter.gotdns.org/svn/a2bfc/trunk@93 1b90f75b-8b96-4784-87c0-14078182fce6
76 lines
3.7 KiB
Plaintext
76 lines
3.7 KiB
Plaintext
Connecting 1-Wire devices to your Apple II is dead simple. A 74HCT126 quad
|
|
three-state buffer, a 4.7k resistor, a 0.1uF capacitor, and the appropriate
|
|
connector to plug into the 16-pin joystick port is all you need. (The 9-pin
|
|
joystick port on the IIe and later machines is inadequate for our purposes
|
|
since it has no outputs.) The circuit looks something like this:
|
|
|
|
+5V o--------------+-------| C1 |-----o GND
|
|
| | 0.1uF |
|
|
AN0 o-------| / +-----|(-----+
|
|
| \ R1 | |
|
|
| / 4.7k v U1 v
|
|
|\| \ Vdd 74HCT126 Vss
|
|
| \ |
|
|
GND o-----| >-----+------+----------------------------------o to 1-Wire bus
|
|
| / |
|
|
|/ U1A |
|
|
|
|
|
| GND o--+---+---------+---|
|
|
+5V o------| | | | | |
|
|
|/| | | |\| | |\|
|
|
/ | | | | \ | | \
|
|
PB2 o-----< |------------| |-| > |-| >
|
|
\ | | / | /
|
|
\| U1B |/ U1C |/ U1D
|
|
|
|
We use four signals on the joystick connector:
|
|
|
|
+5V (pin 1) 5V power supply
|
|
GND (pin 8) system ground
|
|
AN0 (pin 15) annunciator 0 output
|
|
PB2 (pin 4) pushbutton 2 input
|
|
|
|
Something similar to DigiKey part # CDP16G-ND would be a suitable connector
|
|
to plug into the joystick connector, with a ribbon cable leading away to a
|
|
breadboard or an external enclosure for the circuit. If you built the
|
|
circuit on a PC board for in-computer installation, a 16-pin wire-wrap
|
|
socket would work (and would allow passthrough connection of a joystick or
|
|
paddles). To wire up the circuit on a breadboard, use this list of
|
|
connections:
|
|
|
|
- pin 1 of the joystick connector to one end of R1
|
|
to one end of C1
|
|
to pins 14 and 13 of U1
|
|
- pin 8 of the joystick connector to the other end of C1
|
|
to pins 2, 4, 5, 7, 9, and 10 of U1
|
|
- pin 15 of the joystick connector to pin 1 of U1
|
|
- pin 4 of the joystick connector to pin 11 of U1
|
|
- pin 12 of U1 to pin 3 of U1
|
|
to the other end of R1
|
|
to the data I/O pins of your 1-Wire devices
|
|
|
|
The 1-Wire bus is held high by R1. Devices pull the bus low to send a
|
|
signal; the length of time they hold the bus low determines the type of
|
|
signal. When AN0 is off, the output of U1A is in a high-impedance state so
|
|
that 1-Wire devices can be read through U1B (wired as a buffer) on PB2.
|
|
When AN0 is on, the output of U1A is driven low to send a signal to the bus.
|
|
C1 is a bypass capacitor across the power-input pins of U1. Since U1 is a
|
|
CMOS device, the unused inputs of U1C and U1D are held low.
|
|
|
|
Timing diagrams for the different signals used on the 1-Wire bus are in
|
|
Maxim application note #126 (available at
|
|
http://www.maxim-ic.com/appnotes.cfm/appnote_number/522/ln/en).
|
|
|
|
At the time I wrote this, I was still waiting for a parts shipment to arrive
|
|
from DigiKey. I substituted a 74F00 and 74F125 from the junkbox, and the
|
|
circuit worked OK I suspect other logic types with TTL-compatible I/O would
|
|
also work. Use 1/4 of the 74F00 as an inverter between AN0 and pin 1 of the
|
|
74F125, since the outputs of the '125 are active when the control input is
|
|
low (on the '126, the outputs are active when the control input is high).
|
|
|
|
This circuit doesn't provide parasitic power to 1-Wire devices, so make sure
|
|
their power and ground pins are connected to suitable supplies. Parasitic
|
|
power is described in the datasheets of those devices that support it;
|
|
modifying this interface to support it is left as an exercise for the
|
|
reader.
|