Download CY545 User Manual - Cybernetic Micro Systems
Transcript
CY545 Stepper System Controller www.ControlChips.com However, the CY545 will also accept another form of parameter for the arguments of the commands. This form replaces the numeric argument with a “#” character, and it means to read the actual parameter value from an external source, normally implemented as thumbwheel switches. Only the first parameter of a command with multiple parameters may be read this way, but this is not a severe restriction, since the second parameter is usually a branch address, and could be fixed anyway. Programs may repeat things a variable number of times, but usually go to the same place in the loop. Examples of this new format are shown below: R #<cr> N #<cr> L #,123<cr> Get Rate value from thumbwheels Get Number of steps from thumbwheels Get Loop repeat count from thumbwheels In all cases, the format for the command is identical to that with the numeric arguments, except that the numbers are replaced by the “#” character. Note that this format only works in the ASCII command mode, since the “#” character cannot be distinguished from a valid parameter byte value in the Binary command mode. All other characters of the command stay intact, including the space after the command letter, comma or space between arguments, and carriage return at the end of the command. When these commands are written to external memory, the “#” character is included in the memory contents. Recall that the external memory contents are identical to the characters sent in the direct command mode. The CY545 will act on the character, and read the parameter value every time the program is run, and a command containing the “#” character is read. When the “#” character is processed by the CY545, it generates a special read sequence to get the value of the parameter from the external switches. Each parameter consists of 3, 5 or 8 digits, depending on whether the parameter is a byte or two byte size. Each parameter is assigned an address range of 3, 5, or 8 addresses, generated on the lower byte of the two address latches, controlled by the ALE signal. In order to read a specific digit, the CY545 generates the digit address, latched into the lower address byte latch. It then generates a RD strobe, with the SW_SEL line low. This should enable the data from the addressed switch onto the CY545 data bus. All switches are positive BCD encoded. The CY545 reads the switch value from the lower four bits of the data bus, then converts the value into an ASCII decimal digit. The hex format is not supported for externally read parameter values. © 2002 Cybernetic Micro Systems 47 Chapter 13 - Thumbwheel Switch Support