
bi-directional I/O lines. However, for hosts like the Stamp or PIC, it is a simple matter to
tie these lines together since SOUT is open collector.
Therefore, the minimum number of lines you need are two. An output for the clock and
an I/O line to connect to SIN and SOUT. You'll connect the Enable/Busy pin to +5V and
use a pull up resistor to 5V on the Busy/Mode pin. This allows you to reset the device
and communicate with it. The only problem is, you will have to make sure not to ask the
device for data while it is processing. Most operations are quite fast, but some operations
(generating a tone, or writing to EEPROM, for example) can take a long time depending
on what parameters you specify.
If you need to disable and enable the device, you'll want to drive the Enable/Busy pin.
Using this pin allows you to share the SIN, SOUT, and CLK lines with other devices that
use a similar protocol. So to connect 5 Paks you'd only need 7 I/O lines (5 enables, 1
SIN/SOUT, and 1 CLK line). You drive the Enable/Busy pin low to disable the device. If
you don't plan to use this capability, just pull the pin high with a pull up resistor. If you
are using the Busy/Mode input (see below) you can still use a pull up resistor, or just tie
the Enable/Busy pin directly to +5V.
If you ground the Busy/Mode input at start up, the device will also use the Enable/Busy
pin to tell you when it is unavailable. It does this by driving the line low when it is not
ready. That means the host must drive the pin with an open collector output if it wants to
disable the device. If you don't need to disable the device, you can just connect the pin to
a pull up resistor and connect the Enable/Busy pin to an input on the host.
If you want to use a normal output to drive the Enable/Busy pin, but you still want a busy
indication, you can connect the Busy/Mode pin to 5V through a pull up resistor. Then the
Pak IV will use the Busy/Mode pin to signify it is busy (the pin is high when busy). In
this case, the Enable/Busy pin is always an input and you can drive it normally.
One thing to note about the status return: All of the commands will return zeros in the top
bit of the response. You can use this as a form of busy indication if you are unwilling to
use any other pins. Simply read the data pin until it is zero. This indicates that the device
is sending the response. The READX and RIO commands do not follow this convention,
but they take very little time to execute anyway (less than 4 uS).
To summarize, here are the ways you can synchronize with the Pak IV:
1. Monitor the Enable/Busy line while Busy/Mode is grounded. If you bring Enable/Busy
low it indicates that the Pak IV is disabled. If the Pak IV brings the pin low, it means it is
engaged in operations.
2. Place a pull up resistor on the Busy/Mode pin. This will cause the Busy/Mode pin to be
high when the Pak IV is busy.
3. Wait until the data pin goes low before reading responses.