EZ-USB FX2 Technical Reference Manual
Page 10-16 EZ-USB FX2 Technical Reference Manual v2.1
Since all States in this example are coded as NDPs, the GPIF automatically branches from the
last State (S6) to the Idle State (S7). This is the State in which the GPIF waits until the next GPIF
waveform is triggered by the firmware.
States 2 and 3 in the example are identical, as are States 5 and 6. In a real application, these
would probably be combined (there’s no need to duplicate a State in order to “stretch” it, since
each NDP State can be assigned a duration in terms of IFCLK cycles). If fewer than 7 States were
defined for this waveform, the Idle State wouldn’t automatically be entered after the last pro-
grammed State; that last programmed State’s State Instruction would have to include an explicit
branch to the Idle State.
10.3.2.2.2 Decision Point (DP) States
Any State can be designated as a Decision Point (DP). A DP allows the GPIF engine to sample
two signals — each of the “two” can be the same signal, if desired — perform a boolean operation
on the sampled values, then branch to other States (or loop back on itself, remaining in the current
State) based on the result.
If a State Instruction includes a control task (advance the FIFO pointer, increment the GPIFADR
address, etc.), that task is always executed once upon entering the State, regardless of whether
the State is a DP or NDP. If the State is a DP that loops back on itself, however, it can be pro-
grammed to re-execute the control task on every loop.
With a Decision Point, the GPIF can perform simple tasks (wait until a RDY line is low before con-
tinuing to the next State, for instance). Decision point States can also perform more-complex tasks
by branching to one State if the operation on the sampled signals results in a logic 1, or to a differ-
ent State if it results in a logic 0.
In each State Instruction, the two signals to sample can be selected from any of the following:
• the six external RDY signals (RDY0-RDY5)
• one of the current FIFO’s flags (PF, EF, FF)
• the INTRDY bit in the READY register
• a “Transaction Count Expired” signal (which replaces RDY5)
The State Instruction also specifies a logic function (AND, OR, or XOR) to be applied to the two
selected signals. If it’s desired to act on the state of only one signal, the usual procedure is to
select the same signal twice and specify the logic function as AND.
The State Instruction also specifies which State to branch to if the result of the logical expression
is 0, and which State to branch to if the result of the logical expression is 1.
Below is an example waveform created using one Decision Point State (State 1); Non-Decision
Point States are used for the rest of the waveform.
Comentarios a estos manuales