Close
0%
0%

JTAG Knock-Knock

A device that helps you track wires on a circuit board.

Public Chat
Similar projects worth following

    In my opinion, the most appropriate name for this project is JTAG Hello World because it implements the IEEE 1149.1 basic standard. From which the minimum set of functions was used. JTAG was implemented using bit-banging technology. This allowed the entire project to be executed on an Arduino board with a minimal number of additional components. A similar project can be found at https://github.com/alexforencich/ftjrev.

Hardware
    See BUILD INSTRUCTIONS for more information. The device has an Altera USB Blaster-compatible JTAG connector. 

Software

    All software is an Arduino script. A terminal such as Putty or Serial USB Terminal for Android can be used to display the information. The block diagram of the code is shown below.

    The flowchart shows the algorithm of the function 'm' (Monitor), which corresponds to the function Input probing in the project ftjrev.

TAP state machine

SAMPLE

    The easiest way to understand how the algorithm works is by looking at the diagram of the TAP state machine. The figure below shows the algorithm of work of the SAMPLE command.

    Once passed the blue path, we enter the code of the SAMPLE command in the instruction register. After that, the boundary-scan register will be set as the data register. In the future, we do not need to constantly enter the SAMPLE command code in the instruction register, it will remain there until it is overwritten by another instruction or is reset by entering RESET state.

    After that we can constantly move along the green circle, in meanwhile, reading the state of the pins from the boundary-scan register. In accordance with the Standard, upon exiting the Capture-DR state, data on the state of the pins is transferred to the boundary-scan register, which can then be read in the Shift-DR state.

EXTEST

    The algorithm of work of the EXTEST command is very similar to the algorithm for working with SAMPLE, but with some exceptions.

    First of all, it is crucial to remember that working with an EXTEST command without knowing the electronic schematic is not safe. Using EXTEST allows you to set the pin to state 0 or 1, while this pin can be connected to the output pin of another chip, as a result we can get significant currents through these pins. It is unlikely that this will lead to an instant failure, but you should not leave the system in this state for a long time.

    As in the case of SAMPLE, at the beginning, we need to enter the EXTEST command code in the instruction register, this is shown with the yellow path in the figure below.

    Here comes the other thing, in accordance with the Standard, the pin levels are set to the state, which is defined with the boundary-scan register on the falling edge of the TCK in Update-DR state. But when we just entered the EXTEST command code into the instruction register (presumably in the Update-IR state), the state of the pins should already be determined by the contents of the boundary-scan register. So before entering the EXTEST command into the instruction register, it is highly advised to initialize the boundary-scan register with a safe value using the PRELOAD command, which will keep all the pins in the Z-state. Its code usually matches the code of the SAMPLE command.

    It sounds too confusing, but the pseudocode of initializing EXTEST looks pretty simple:

j_Any_Reset_RunIdle();
j_SetIR(SAMPLE, INSTRLN);
j_GetDR(dr2, BOUNDLN);
j_SetDR(dr2, BOUNDLN);
j_SetIR(EXTEST, INSTRLN);

    In this case, we assume that the value stored in the dr2 array after executing the SAMPLE instruction contains the safe value for the boundary-scan register.

    In the future, we can move along the red path reading the status of the pins and controlling them as shown...

Read more »

  • 1 × Arduino Nano
  • 3 × R1..3 = 20..50 Om
  • 1 × Pogo Pin
  • 1 × R4 = 150 Om
  • 1 × R5 = 520 Om

View all 11 components

  • Wake up, Neo... The Matrix has you...

    MorriganR06/14/2020 at 11:35 0 comments

  • Work algorithm

    MorriganR05/01/2020 at 18:52 0 comments

      This document describes the work algorithm of the JTAG Knock-Knock(Device). All experiments were performed with a G-Sync board containing an Intel Arria V GX . The first few steps do not describe the actual usage of the Device, instead they do explain preparatory steps.

    Step 1

      To actually start working, it is needed to determine the placement of the JTAG port on the board. First thought was about two connectors on the end of the board, that has 6 pins each, that is the one we are going to check. With a regular tester it is not difficult to determine which pins in connected to the ground. Unfortunately, it is not enough to deal with other pins. Since it is not the purpose of the Device, JTAGenum was used. Click on the link, in order to find detailed instructions on how to use it and the Arduino sketch code. Connect Arduino to the board to start searching for JTAG pins.

    Fig.1 ArduinoEnumPhoto

      After just a few seconds of functioning we see the following result in the terminal:

    Fig.2 JTAGEnumTerminal

      The line we need is highlighted with white. That so conformity of JTAF signals and physical pins is found.

    pin 1 - TMS
    pin 2 - TDI
    pin 4 - TDO
    pin 5 - TCK
    

    Step 2

      Using the information from the previous step, it is possible to make a cable to connect USB Blaster easily. Now connect the USB Blaster to the board and make sure that the Quartus Programmer sees the FPGA installed on the board.

    Fig.3 ProgrammerPhoto

      With Quartus Programmer it is important to delete the configuration stored in flash memory. If you carefully read the documentation on the Intel Arria V GX , you may notice that the BSDL file contains information, that is relevant only for the unconfigured FPGA chip. The warning is given at the beginning and end of the BSDL file .

    Fig.4 BlankCheck

      Once again make sure that the flash memory is clean, that so the FPGA will remain unconfigured after the board starts.

    Step 3

      Find the BSDL file for the Altera Arria V GX chip, in order to know following information:

    attribute INSTRUCTION_LENGTH of ARRIA_V_5AGXMA3DF31 : entity is 10;
    attribute BOUNDARY_LENGTH of ARRIA_V_5AGXMA3DF31 : entity is 1488;
    ...
    "SAMPLE (0000000101), "&
    

      This info can be added directly to the Arduino Code of the Device or entered manually while using the Device with the command "s" - Set SAMPLE Code.

    Step 4

      As you can see on photos below Serial USB Terminal for Android is used, though you can use any Serial Terminal, such as PuTTY for Windows/macOS. The Arduino board is connected to the phone with an OTG cable, the speed is given here .

    Fig.5 JTAG_Knock_Info

      When everything is connected properly, the command "i" - Info will give us some basic information about the chips connected to the JTAG Chain and display them on the terminal. Check carefully that the received information matches expectations.

    Step 5

      At this point, you can try monitoring mode by entering the command "m" - Monitor

    Fig.6 JTAG_Knock_MonitorWithoutBlock

      The terminal will show numbers of bits that change in the Boundary scan register. These can be bits that reflect the state of real chip pins, as well as bits of some internal states. It is almost impossible to work with such a flow of information, so it is necessary to block displaying of bits that change without externally affecting the board. This can be done with entering the lock mode using the command "b" - Block.

    Fig.7 JTAG_Knock_Block

      After a while, new lines will stop appearing on the screen, this usually takes from 5 to 20 seconds. Then we can see the bit numbers that have been added to the lock register by typing "l" - List in the terminal.

    Fig.8 JTAG_Knock_BlockListAndMonitor

      As a result, we have a list of over twenty Boundary scan register bits that are constantly changing. This list of bits can be divided into two groups. First one contain bits, in our case, it is 0, 2, 9, 12, 13, 14, 15, 17, 21, 22, for which the only information, that can be found in the BSDL file is this:

      "0     (BC_4, *, internal, X)," &
      "2     (BC_4, *, internal, X)," &
     "9 (BC_4, *,...
    Read more »

View all 2 project logs

  • 1
    Collect all necessary components.
  • 2
    Unpack all components.
  • 3
    Attach all connectors to the board and resistors to socket pins.

View all 6 instructions

Enjoy this project?

Share

Discussions

Donnie Agema wrote 03/17/2020 at 09:25 point

Very interesting project, but I could not infer the theory of operation or usage from the .ino, and the video has no sound so it also did not help in understanding.  Will you be elaborating how to use?

  Are you sure? yes | no

MorriganR wrote 03/17/2020 at 22:04 point

Of course, I plan to describe the operation of this device soon. 

  Are you sure? yes | no

Donnie Agema wrote 03/17/2020 at 22:33 point

Great! Thanks.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates