![[Logo]](gif/logo.gif)
Finally, the CY545 has several miscellaneous commands for general control purposes. One command provides a software reset for the CY545. It is:
I Initialize CY545
When the Initialize command is processed, it acts like a power-on reset. The CY545 command mode is changed to direct command mode, all I/O signals are brought high, and the serial baud rate is reset. Any program that was executing from external memory is stopped if an I command is read.
The Initialize command or power-on reset also fix the CY545 stepping parameters as follows:
R ..100
F ..14
S ..220
N ..200
and the current position register is cleared to zero.
The current values of these registers will always be changed back to the defaults when a reset is performed or an I command is executed.
The CY545 also provides a time delay function, with:
D Del16 ....Delay for specified milliseconds
The parameter for the Delay command is a 16-bit value, calibrated in milliseconds when running at 12 MHz. This command simply causes the CY545 to wait for the specified time before going to the next command.
When used in an external memory program, the command allows you to pause for a known time between program functions. For example, take a specified motion to move a part into place, then delay for 3 seconds while some operation is performed, then remove the part.
The value of the Delay parameter allows a time delay between 1 millisecond and 65 seconds when the CY545 is running at 12 MHz. Longer delays can be created by repeated delay commands, or delay commands in a loop.
Also note that very slow stepping is possible by a loop that consists of a single-step relative motion followed by a time delay. For example:
Y 10<cr> .........Select address
10 to start code
E<cr> ............Enter to memory
---------------
|.N 1<cr>.....|......Set
to 1 step relative
|.+<cr>.......|......Select
CW direction
|.G<cr>.......|......Take
a step
|.D 2000<cr>..|......Delay
2 seconds
|.L 50,16<cr>.|......Loop
back to G command, 50 times
|.0<cr>.......|......Stop
program
---------------
Q<cr>.............Quit entering
program to memory
Y 10<cr> .........Reset address
X<cr> ............Run the program
The above example will take 50 steps, with a delay of two seconds between steps. Other delay values will provide different step rates.
Display CY545 Status
Along with display strings, the CY545 allows you to query the values of various working parameters. The command is:
? Cmd.....Query specified parameter value
The “Cmd” portion of the Query command is a single letter, selecting the parameter for display. Possible choices are:
N.....Number of Steps value
P.....Current position value
R.....Current final rate value
F.....Current first rate value
S.....Current slope value
Y.....Current memory address pointer
value
B.....Current user bits input value
When the Query command is received or read from memory, the CY545 displays the parameter value as follows:
X=vvvvv<cr>.....ie:.....S=00220<cr>
Where “X” is the parameter letter, and “vvvvv” is the 5-digit ASCII decimal value for the parameter. Parameters that only have 8-bit values will have leading zeros for the unused digits. This is a fixed format output while the CY545 is in the ASCII command mode. Since Position and Number of steps are 24-bit values, these two queries will output an 8-digit number, not the standard 5-digit number.
In the Binary command mode, the “vvvvv” portion is replaced by two bytes that represent the binary value of the parameter, sent most significant byte first. The carriage return is not sent in the Binary command mode. Position and Number are sent as three byte values.
The parameter value message is sent to the currently selected display device, so it is possible to send the result to something other than the command source. For example, a host computer could issue the Query command over the serial interface, with the CY545 displaying the result on a local HP display.
![[Figure 10.2]](gif/545-23.gif)
Each query command will output the current value of the requested parameter. For the user-bits query, a 16-bit value is returned, with the lower 8 bits corresponding to the CY545 User Bits, and the upper 8 bits corresponding the the CY545 Data bus.
One
more parameter may be issued for the Query command, the “M” parameter.
The format for this form is special, because it also includes a second
parameter, which is a count value. For example:
? M,5<cr>
For this Query command, the “M” is selecting a query of the external memory, and the count indicates how much to display.
The memory display starts by showing the value of the memory address pointer, since the query will start at this address. This is followed by the number of lines specified by the count value. Each carriage return read from the memory counts as one line. This format operates in the ASCII command mode.
In the Binary command mode, you may still perform a memory query, and the query command takes two parameters, the “M”, and the count. However, in this case, the count is the number of bytes to read from the memory, not the number of lines.
The CY545 also provides a mechanism for displaying messages that you define. This is done by:
"String" ......Display all characters between quotes
Normally, these messages would be part of a program in external memory, and can announce specific items on the display. The messages can also be prompts to an operator to turn something on or off at particular points in a program, with the CY545 then delaying, or waiting for a signal before continuing with the program.
The string format is very general. Any character is allowed between the quotes (except another quote), including ASCII control codes and carriage returns. The only character that terminates a display string is the double quote character (ASCII 22H), also used to start the string. This is the only character that may not be part of the string.
Strings are stored in external memory if they are received following an Enter command, just as regular CY545 commands. Every part of the string, including the starting and ending quotes is saved. The next CY545 command immediately follows the ending quote of the string. In Binary mode, strings do not include data counts, they are treated like ASCII mode for the duration of the string.
Embedded Control Characteristics and Their Use:
The string command allows any 8-bit characters (except ") to be transmitted as part of the string. This will allow embedded control codes and special "setup" commands to be issued to peripheral devices, such as the CY325 LCD windows controller. For example, the string:
"<Ctrl-C>V 0D6h<cr>
<Ctrl-D>Hello<cr>"
puts the CY325 into the command mode (Ctrl-C character), then issues a Viewport command, which defines a currently active window for display. The window selected uses one quarter of the 711 display, from the middle. The Ctrl-D character then places the CY325 back into the display mode, and the message “Hello” is written to the selected window. The carriage return advances the cursor to the line directly below the “Hello” message.
The above sequence is sent as one string message by the CY545, since all the commands and control codes are embedded within one character sequence, between the double quote characters.
Finally, the CY545 has a special command for controlling the Hewlett Packard display. The command is:
[Addr,Cnt,D1,...,Dn.....Special Hewlett Packard display support
This HP Display command allows you to manipulate some special features of the HP display, such as brightness control or custom character fonts. Use of this command is optional, since it changes the defaults as set by the CY545. It is not required for normal operation of the HP display.
LED Display Details
The address parameter is the display address used to write the data and control information. For example, 30H is the address for the HP control register. The count parameter is the number of data bytes to write, starting at the specified address. If the count is zero, nothing is written, but the internal display address is changed to the specified first parameter value. When the count is non-zero, the following bytes are written to the display, with the count determining how many bytes are written.
One address is treated specially by this command, address 30H, for the control register. If address 30H is followed by a zero data count, the CY545 default control value will be selected. Otherwise, the value of D1 will become the new control register value, and can be used to change the display intensity or turn on the blinking feature.
For more information about the HP display and CY545 support, see a later section on Display Support and the HDSP-211x data sheets (available from Hewlett Packard).
Also note that the HP display is limited to 8 characters, so the Query output format automatically changes when the HP display is selected, and the Position or Number parameter values are queried. In these cases, only the 8 digit value is shown, not the parameter letter and equal sign. For example, instead of showing:
N=12345678<cr>
as it would for a normal serial or parallel display, the CY545 simply shows:
12345678<cr>
when the ? N or ? P commands are issued for the HP display.
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