27
I O S E x e r c i s e # 1 : S e t t i n g a D e d i c a t e d O u t p u t
We want to connect an LED to I/O line 21
that will illuminate when the motor is moving.
Connect the LED to the I/O line as shown.
Enter the following in the terminal:
IOS 21 = 18,1,0
The “18” tells the MicroLYNX that I/O line 21
is to be a dedicated Moving output. The second
parameter MUST be set to “1”
defining the line as an output. We
set the third parameter to “0”
making the line active LOW.
Now let’s test the configuration by
turning the power on and entering
the following into the terminal:
SLEW 200000
When the motor is moving the LED should be illuminated. By
striking the Escape (Esc) key, the motion should stop and the LED
will turn off.
IOS Exercise # 2A: Setting a Dedicated Input Active Low
In this example we want to connect a switch that will soft stop the motor
when pressed. Because we leave the connections and settings from the previ-
ous example when we use the switch to stop the motion the LED will
turn
off
, verifying to us that step-clock pulses are no longer being sent to the
motor driver.
Connect the switch as shown. Set the pull-up switch for I/O line 22 in the
ON position, pulling the line up to the in5 volts.
Enter the following into the terminal:
IOS 22 = 10,0,0
The “10” instructs the MicroLYNX to set
I/O line 22 to be a dedicated Soft Stop
input. Since it is an input, the second
parameter is set to 0. The third parameter
is set 0, or active LOW, as the switch will
pull the input down to ground.
Now, we test the configuration by entering
“SLEW 200000” into the terminal, the LED
should turn off. Press the switch. The
motor should stop and the LED illuminate.
When setting a dedicated
input or output, the
second parameter must
match the function
specified by the first
parameter, either input
or output, or an error
will occur!
I/O LIN E 22
P U S H B U T TO N
S W IT C H
I/O G N D
Figure 8.5: IOS Exercise #2A
I/O LIN E 2 1
C U R R E N T
L IM IT IN G
R E S IS T O R
L E D
V P U LL
Figure 8.4: IOS Exercise #1
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from