// This command sequence is to detect how many devices is on the JTAG chain TRST OFF; ENDIR IDLE; ENDDR IDLE; STATE RESET IDLE; TIR 0 ; HIR 0 ; TDR 0 ; HDR 0 ; // load enough ones to fill all IRs with 'bypass' command SIR 128 TDI (ffffffffffffffffffffffffffffffff); // shift 1 many times and see where it will show up, i.e. if it is in bit3 // then we have 2 devices in the chain SDR 32 TDI (00000001);