CY545 Stepper System Controller
www.ControlChips.com
© 2002 Cybernetic Micro Systems
Chapter 6 - Bit Function Commands
21
Bit Function Commands
Several commands allow you to specify which User Selectable Bits are used by the command.
The CY545 has at least six general purpose signals available, even if all hardware support
options are used. More bits are available when some hardware support, such as the Hewlett
Packard LED display, the CY233, or the parallel interface are not used. Each of these
commands includes a parameter which specifies which bit or combination of bits to use with the
command. The specific values are discussed with the relevant commands.
User Bits
One command allows you to set or clear specified bits. It is:
B Bit
Set or clear specified bits
When in the ASCII mode, this command also allows a special format, using a complement prefix
to mean the inverted value of the specified bit parameter. The prefix is the “/” character, and is
used as follows:
B 2<cr>
Set User Selectable Bit 2 high
/B 2<cr>
Clear User Selectable Bit 2 low
The same function may be performed by the bit parameter value. When a “/” character is
detected, it simply complements the fourth bit of the bit value parameter, so the same functions
as above can be specified by:
B 02H
<cr>
Set Bit 2
B 12H
<cr>
Clear Bit 2
The “/” character is equivalent to performing an exclusive OR (XOR) of the bit number
parameter and the value 10H (16 decimal).
The value of the Bit parameter will determine what action to take, as follows:
00H to 07H
(
..
0-7)
Set one of user bits 0 to 7
08H to 0FH
(
.
8-15)
Set one of data bus bits 0 to 7
10H to 17H
( 16-23)
..
Clear one of user bits 0 to 7
18H to 1FH
( 24-31)
..
Clear one of data bus bits 0 to 7
20H to 3FH
(
32-63)
.
(Same as 00H to 1F)
40H to 7FH
.
( 64-127)
.
Set user bits 0 to 5 at one time
80H to 0BFH
.
(128-191)
.
AND user bits 0 to 5
0C0H to 0FFH
.
(192-255)
.
OR user bits 0 to 5
As seen from the above values, the bit argument is composed of an “opcode” part and an
“operand” part. The general coding of bit arguments is shown below:
C
C
C
H
H
H
A
A
A
P
P
P
T
T
T
E
E
E
R
R
R
6
6
6
-
-
-
B
B
B
I
I
I
T
T
T
F
F
F
U
U
U
N
N
N
C
C
C
T
T
T
I
I
I
O
O
O
N
N
N
C
C
C
O
O
O
M
M
M
M
M
M
A
A
A
N
N
N
D
D
D
S
S
S