- ページ 2

アクセサリー Dynalloy Muscle Wires FrankenSerial InterfaceのPDF クイック・スタート・マニュアルをオンラインで閲覧またはダウンロードできます。Dynalloy Muscle Wires FrankenSerial Interface 5 ページ。 Moving electronics kit

additional connection at each end for +5 Vdc (top) an ground (bottom). This lets you conveniently
install resistors between the I/O pins and +5 Vdc or ground using SIP resistor packs. If you want to
exclude one of the I/O pins from the pullup or pulldown connection, you can simply cut the
corresponding pin off the resistor pack.
Using and reconfiguring the ADC
The voltage to be measured with the ADC must be positive and referenced to the Interface's ground.
Do not connect negative voltages, or positive voltages exceeding the ADC voltage reference voltages by
more than 0.5 volts, to the ADC. The input to the ADC is J2. The input is marked +; the other pin is
ground.
The ADC's voltage reference is normally wired to its positive power-supply
connection y installing a jumper wire at R1 and leaving D1 empty, giving it a
range of 0 to 4.7 Vdc. (The range is not 0 to 5 Vdc as you might expect because
the ADC gets its power from an Interface I/O pin, which has a small internal
voltage drop.) If you want to reduce the upper limit of the ADC's range, you may
install a zener diode at D1 and 1K resistor at R1 D1 and R1 are not included with
the kit). A 3.3-volt zener at D1 will give the ADC range of 0 to 3.3 Vdc. When you install the zener,
make sure that its striped end lines up with the stripe on the printed symbol on the board.
The LM336 2.5-volt zener comes in a three-wire, TO-92 package. You can install it as shown in figure
3. The unused terminal is meant to allow fine adjustment of the zener voltage or connection of
temperature-compensation circuitry. For most applications, it's not needed, since temperature drift over
a range from subfreezing to boiling will cause about a 1-bit change in the ADC output.
Caution: Do not connect the ADC's reference pin to a voltage higher than its supply voltage (at pin 8).
Doing so will damage the ADC.
Programming the Stamp 1
Your Stamp programs control the Interface by issuing commands to it using Serout (2400 baud,
inverted). The commands are abbreviations of the corresponding Stamp commands. For example, to
change Interface pin 13 to output/low, your program would say:
Serout 0,N2400,("L",13)
The commands must be in uppercase. Numbers sent to the Interface may be either constants (as
shown), or variables. Do not precede them with the # character, since this causes the Stamp to convert
them to ASCII text, which the Interface doesn't understand.
The accompanying table lists Interface commands with PBASIC examples. Note that input commands ,
such as Bit, require two PBASIC instructions. The first instruction is a Serout, to send the command to
the Interface, while the second is a Serin, to receive the data.
Using sleep mode
The Interface's Sleep mode reduces current draw to less than 1 mA, not counting any loads it may be
driving. The interface awakens periodically to check its serial connection to the Stamp to determine
whether it's time to wake up. If the serial line is low, as it normally is, the Interface goes back to sleep.
If it is high, the Interface wakes up and waits for the serial input to go low again. When it does, the
Interface returns to normal operation.
How often the Interface checks for the wake-up signal depends on the value sent with the Sleep (S)
command as follows:
F2893
1-089 V3.0 ©MMVII Muscle Wires®
and Flexinol® are registered trademarks of Dynalloy
Interface Sleep Durations
S0
18ms
S1
36 ms
S2
72 ms
S3
144ms
Every time the Interface checks for the wake-up signal, any pins that are configured as outputs will float
for approximately 18 ms. The internal reset mechanism that periodically wakes the Interface to allow it
to check the serial line also briefly forces al pins to input mode, causing them to float. Make sure that
any loads driven while the Interface is asleep can tolerate this glitching. (The Stamp does the same
thing during its Sleep, Nap, and End modes, by the way.)
To wake up the Interface, the Stamp should output a high on the serial communication line for at least
twice (preferable three times) the length of the Interface's sleep interval. For best ADC accuracy, don't
request an analog reading for at least 50 ms after waking up the Interface.
Programming Tips
Reprogramming the Stamp (ALT-R) does not reset the Interface. During program
development, you may want to start your program with several reset commands (*) to put the
Interface into the same state it is in when power is first applied. An alternative is to
disconnect power from the Interface to cause it to forget previous states before
reprogramming. If reprogramming the Stamp interrupts it while it's sending data, the
Interface may receive the interrupted command incorrectly. Again, the solution is to get the
Interface into a known state by cycling its power.
At 2400 baud, it takes about 4.2 ms to send a byte of data. This limits the maximum rate at
which you can write data to or get data from the Interface's I/O pins. For example, the
Toggle instruction takes two bytes so the fastest you can toggle an Interface bit is every 8.4
ms, or approximately 129 times a second (ignoring the Stamp's program-execution time).
Try to divide up I/O responsibilities so that the fast jobs go to the Stamp's pins and the slow
jobs to the Interface. (A9600 baud, the situation is better, but the Stamp's own I/O's are still
faster.)
Take advantage of automatic data-direction settings. Just like the Stamp, the Interface wakes
up with all of its pins configured as inputs. The commands High, Low, and Toggle all set the
specified pin to output and leave it in that state. The Read and Write commands do not
change the data directions of the pins. Values written to pins that are configured as inputs
are stored in internal registers of the PIC controller. They don't affect the state of the pins
until the pins' data direction is set to output. Likewise, pins that are configured as outputs
can be read, but you will be reading the state most recently written to them.
S4
288 ms
S5
576 ms
S6
1152 ms
S7
2304 ms