SET Statement for Raw JTAG Access
This form of the SET statement is used to access JTAG pins and PIO pins.
If the TAP controller state is manually changed using a SET statement, e.g. by directly accessing the JTAG pins or performing some PIO operation, then the INJTAGSTATE statement must be used to notify the system of the new state so that future JTAG accesses work correctly.
The :=* operator allows a pin to be read the value without disabling its output.
For JTAG pins (TDI, TDO,...), this form of the SET statement can only be used inside a JTAG block. For XJLink2 PIO pins, it is also allowed outside of a JTAG block. nTRST pins can can be thought of as PIO pins with SET statements, and can be accessed via a PIO set statement either inside or outside a JTAG block.
Syntax
SET [ [ jtagPin | PIO.pioPin ] := I | [ jtagPin | PIO.pioPin ] := value | variable := [ jtagPin | PIO.pioPin ] | variable :=* [ jtagPin | PIO.pioPin ] ] { , ... };
Parameters
- jtagPin
-
Any one of the possible JTAG pins: TDI, TDI2 to TDI8, TDO, TDO2 to TDO8, TCK, TCK2 to TCK8, TMS, TMS2 to TMS8, RTCK.
In versions of XJTAG prior to v4.0, the pins TCKb, TCKc and TCKd, and TMSb, TMSc and TMSd were used in place of the numbered TCK and TMS pins. These forms are still supported for backwards compatibility, but will be removed in a future version of XJTAG.
- pioPin
-
The name of a PIO or nTRST pin defined in the pin mapping.
- variable
-
An integer variable in which to store the value read from the pin.
- value
-
An integer value of zero or one to set on the pin, or the value I to set the pin as an input.
Errors
An error can occur in the following circumstances:
- The specified pin is not defined in the pinmap.
- A JTAG pin is referenced directly in a SET statement outside a raw JTAG block.
Example
This example performs a TMS reset (five clock ticks with TMS held high), while holding nTRST high:
INT i; JTAG SET TMS := 1, TCK := 0, PIO.nTRST := 0; SET PIO.nTRST := 1; FOR i := 0 TO 5 SET TCK := 1; SET TCK := 0; END; INJTAGSTATE ("RESET"); END;
XJTAG v4.1.100