I am using Board FPGA Spartan3 and want to readback using JTAG TDO pin, the following is part of my source code (based on the TAP state machine):
My question is that it seems that no data is clocked out of the TDO pin
process (JCLK)
begin
if rising_edge(JCLK) then
.........................
...............................
if (COUNTER = 17) then -- IDCODE Bit 5=0
TMS <= '0';
TDI <= '0';
end if;
if (COUNTER = 19) then --IDCODE Bit 6 (MSB)=0 --Exit-IR1
TMS <= '1'; --Update-IR --Select-DR-Scan
TDI <= '0';
end if;
if (COUNTER = 25) then --Capture-DR --Shift-DR
TMS <= '0';
TDI <= '0';
end if;
if (COUNTER = 29) then --
TMS <= '0';
DATAOUT_SIG(0) <= TDO;
end if;
if (COUNTER = 31) then
TMS <= '0';
DATAOUT_SIG(1) <= TDO;
end if;
TDO is definited in the entity as : in std_logic; --Test Data Out
and DATAOUT_SIG is signal of 32 bits width.
Can any one perhaps tell me where is wrong with this using style of readback IDCODE?