I have some comments about the firmware:
At line 46 you write the RESET_CHIP command to the GPIB_AUXMR. This
clears the GPIB_HIER and GPIB_MISC regsiters you configured in lines 43
and 44.
At line 72 you are setting the CPT_EN bit. This bit is used to detect
undefined GPIB commands by asserting an interrupt. Do you need this
functionality?
At line 66, you are setting REOS and at line 75 you are writing 0x0A to
the EOSR. This means that whenever the TNT4882 receives the byte 0x0A
it will stop. Is this the intended behavior?
My C skills aren't the best, but you have two different functions,
outportb and OUTPORTB. They only seem to differ by the capitalization
and I can't find the implementation of these functions. Do they differ
in some manner?
I also have some comments about the register values after the failure:
ISR1 indicates that END is set. This may be due to the REOX setting I mentioned earlier.
I assume you are using the TNT as a non GPIB controller. Is that
correct? Are you connecting to an NI GPIB controller (like a PCI-GPIB)
and using the NI-488.2 driver for that GPIB controller?
I see you have an interrupt handler set up. What interrupts do you receive during the failing and passing cases?
Also, I don't quite understand the error condition reported during the failure. Is it just a timeout?
Some of the other regulars on this board are much more knowledgeable
about TNT4882 firmware, so maybe they will have some more ideas.