CY545
[Logo].

Chapter 07
External Memory Support Commands


External Memory Support Commands

Several CY545 commands provide support for the optional external memory. They control the addressing, data entry, and execution of commands from the memory.

External Memory Address Pointer

The first command is used to set the address pointer. It is:

The 16 bit argument to the Y command is placed into the memory address register of the CY545. Other commands may use this value for their functions.

The Y command does not change modes or other features of the CY545, so when issued as a direct command, it simply sets up the address pointer. The CY545 will then wait for the next command. However, when the Y command is executed from external memory, redefining the address pointer causes the CY545 to execute commands from the new address, so the Y command becomes a 16-bit jump command. This dual function allows you to specify the working address when defining the memory contents, and jump to any location of the memory when running from the memory contents.

Writing Commands into Memory

The two commands that control the entry of data into memory are:

The Enter command is issued to the CY545 in the direct command mode. Once this command is executed, the CY545 changes to the program entry mode. All following commands will be written to the external memory. The CY545 will not execute any of the commands, it simply writes them into the memory.

The memory contents consist of a string of characters, and are identical to the characters issued to the CY545 in direct command mode. Every character sent to the CY545 will be recorded in memory exactly as it is sent to the part.

The memory writing function continues until the CY545 receives a Quit command. It then returns to the direct command mode, in which every command is executed immediately as it is received. The address pointer value now contains the address where the next character would have been written, and the difference between the starting value and ending value will indicate the amount of memory required for your program. Before running the program, the Y command should be used to redefine the pointer value for the start of the program.

Note that the carriage return character is optional after the Quit command in the ASCII command mode, and a data count is not used after the Quit command in the Binary command mode.

[Figure 7.1]

Running From External Memory

Two commands are involved in running programs from the external memory. They are:

The Execute command changes the CY545 from the direct command mode to the program execution mode. Your program will begin running from external memory, at the current address in the address pointer. The X command would normally be preceded by a Y command to set the program starting address.

In the program execution mode, the CY545 will begin reading command characters from the memory, incrementing the address pointer after every read operation. When an entire command has been read into the part, that command is executed similarly to directly issued commands.

When the current command is finished, the CY545 will read the next command from memory and execute it. This process continues until the CY545 finds a stop command.

The Zero command (ASCII character 0, not binary value zero) is the stop execution command. When this command is executed, the CY545 changes from program execution mode back to direct command mode. It then waits for the next command to be issued by the host system. Note that in the Binary command mode, the binary value zero should be used for the stop execution command, followed by a zero value data count.

You may also issue commands to the CY545 while it is running a program from external memory. The CY545 will process these commands between the commands read from the memory. The ability to issue direct commands while the CY545 is running an external memory program provides a degree of "live" interaction, allowing you to change parameters or modify the execution flow by the direct commands. It is even possible to halt a program, by issuing the Zero command!

Note: A special feature of the CY545 is the ability to automatically run an external program at power-up, or whenever the CY545 is reset. See the "Auto-Start" feature in 12-External Memory.

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:

The following 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.

00 Contents ..|.. 01 Intro ..|.. 02 Pins & Packages ..|.. 03 Cmd Interfaces ..|.. 04 Commands..|.. 05 Motor Cmds
06 Bit Cmds..|.. 07 Memory Cmds..|.. 08 Prog Branch Cmds..|.. 09 Mode Cmds ..|.. 10 Misc Cmds
11 Circuits ..|.. 12 External Memory ..|.. 13 Thumbwheel Switch ..|.. 14 Output Display ..|.. 15 Proto Boards
16 Timing & Control ..|.. 17 Rate Tables ..|.. 18 Electrical Specs ..|.. 19 Examples ..|.. 20 Up & Running
Back to CY545 Data Sheet

© 1988 - 1999 Cybernetic Micro Systems, Inc. All rights reserved.
CY545 Manual 22MAR99