CY545 Stepper System Controller
www.ControlChips.com
Example
From this discussion, you can see that one command controls the basic memory addressing
function, while two pairs of commands control the definition of memory contents and execution
of memory contents. A simple example is shown below:
F 15<cr>
S 200<cr>
Define some parameters in direct mode
....
Additional commands are possible here
Set memory pointer to address 50
Start program entry at location 50
Y 50<cr>
E<cr>
The following highlighted code is written to memory, but not executed:
N 400<cr> .
+<cr>
G<cr?
First command in external memory
Take 400 CW steps
D 1000<cr>
N 350<cr>|
-<cr>.
Delay for 1 second (1000 msec)
Reset number of steps
G<cr>
Take 350 CCW steps
Delay for 0.75 seconds
Stop, last command in external memory
D 750<cr> .
0<cr>
Q<cr>
.......
Y 50<cr> .
X<cr>.
End of program definition
Other direct mode commands may be here
Reset address pointer to prog start
Execute. Begin running the program
The program in the external memory will run after the X command, and will continue until the
stop command is found. The program takes two relative motions, with different numbers of
steps, and in different directions. When the Stop command is seen, the CY545 goes back to
direct command mode and waits for the next command. The program could be repeated by
sending the Y and X commands again, since the program continues to reside in the external
memory.
If non-volatile external memory is used, such as an EEPROM, the program will be stored in the
memory even when power is removed from the CY545 system. So, once a program is defined,
it may be used over and over, by simply pointing to the program address and sending the
Execute command.
More hardware details about external memory support are provided in a later section.
© 2002 Cybernetic Micro Systems
28
Chapter 7 - External Memory Commands