CY545 Stepper System Controller
www.ControlChips.com
© 2002 Cybernetic Micro Systems
Chapter 7 - External Memory Commands
28
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>
Define some parameters in direct mode
S 200<cr>
.
...
Additional commands are possible here
Y 50<cr>
Set memory pointer to address 50
E<cr>
Start program entry at location 50
The following highlighted code is written to memory, but not executed:
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.
N 400<cr>
.
First command in external memory
+<cr>
G<cr?
Take 400 CW steps
D 1000<cr>
Delay for 1 second (1000 msec
)
N 350<cr>
|
Reset number of steps
-<cr>
.
G<cr>
Take 350 CCW steps
D 750<cr>
.
Delay for 0.75 seconds
0<cr>
Stop, last command in external memory
Q<cr>
End of program definition
..
...
..
Other direct mode commands may be here
Y 50<cr>
.
Reset address pointer to prog start
X<cr>
.
Execute. Begin running the program