Datasheet

Data Sheet AD9557
Rev. B | Page 41 of 92
EEPROM Conditional Processing
The condition instructions allow conditional execution of
EEPROM instructions during a download sequence. During
an upload sequence, however, they are stored as is and have
no effect on the upload process.
Note that, during EEPROM downloads, the condition instructions
themselves and the end instruction always execute unconditionally.
Conditional processing makes use of two elements: the condition
(from Condition 1 to Condition 8) and the condition tag board.
The relationships among the condition, the condition tag board,
and the EEPROM controller appear schematically in Figure 42.
The condition is a 5-bit value with 32 possibilities. Condition = 0
is the null condition. When the null condition is in effect, the
EEPROM controller executes all instructions unconditionally.
The remaining eight possibilities (that is, condition = 1 through
condition = 8) modify the EEPROM controllers handling of a
download sequence. The condition originates from one of two
sources (see Figure 42), as follows:
FncInit, Bits[7:3], which is the state of the M2 to M3
multifunction pins at power-up (see Table 22)
Register 0x0E01, Bits[3:0]
If Register 0x0E01, Bits[4:0] ≠ 0, then the condition is the value
that is stored in Register 0x0E01, Bits[4:0]; otherwise, the condition
is FncInit, Bits[7:3]. Note that a nonzero condition that is present
in Register 0x0E01, Bits[4:0] takes precedence over FncInit,
Bits[7:3].
The condition tag board is a table maintained by the EEPROM
controller. When the controller encounters a condition instruct-
tion, it decodes the B1 through CF instructions as condition = 1
through condition = 8, respectively, and tags that particular
condition in the condition tag board. However, the B0
condition instruction decodes as the null condition, for which
the controller clears the condition tag board, and subsequent
download instructions execute unconditionally (until the
controller encounters a new condition instruction).
During download, the EEPROM controller executes or skips
instructions, depending on the value of the condition and
the contents of the condition tag board. Note, however, that
condition instructions and the end instruction always execute
unconditionally during download. If condition = 0, then all
instructions during download execute unconditionally. If
condition ≠ 0 and there are any tagged conditions in the
condition tag board, then the controller executes instructions
only if the condition is tagged. If the condition is not tagged,
then the controller skips instructions until it encounters a
condition instruction that decodes as a tagged condition. Note
that the condition tag board allows for multiple conditions to be
tagged at any given moment. This conditional processing
mechanism enables the user to have one download instruction
sequence with many possible outcomes, depending on the value
of the condition and the order in which the controller
encounters condition instructions.
EXAMPLE
COND
ITION 3 AND
CONDITION
13
ARE TAGGED
EEPROM
EEPROM CONTROLLER
UPLOAD
PROCEDURE
CONDITION
HANDLER
DOWNLOAD
PROCEDURE
CONDITION
TAG BOARD
1 6543
2
11109
8
7
30
31
24
23
22
2
12019181
716
1
51
4
13
12
25
26 27 28 29
IF B1 ≤ INSTRUCTION ≤ CF,
THEN TAG DECODED CONDITION
EXECUTE/S
KIP
INST
RUCTION(S)
SCRATCH
PAD
C
OND IT
ION
CO
NDITI
ON =
0E01
, BITS[3:0]
E
LSE
C
ONDIT
ION
= Fn
cIni
t,
BITS[7:3]
END
IF
M3 M2
IF INSTRUCTION = B0,
THEN CLEAR ALL TAGS
FncInit, BITS[7:3]
REGISTER
0x0E01, BITS[3:0]
STORE CONDITION
INSTRUCTIONS AS
THEY ARE READ FROM
THE SCRATCH PAD.
WATCH FOR
OCCURRENCE OF
CONDITION
INSTRUCTIONS
DURING
DOWNLOAD.
IF {NO TAGS} OR {CONDITION = 0}
EXECUTE INSTRUCTIONS
ELSE
IF {CONDITION IS TAGGED}
EXECUTE INSTRUCTIONS
ELSE
SKIP INSTRUCTIONS
ENDIF
ENDIF
5
5 5
IF {0E01, BITS[3:0] ≠ 0}
09197-025
Figure 42. EEPROM Conditional Processing