Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TNT4882 One Chip Mode - TIMEOUT ERROR

I have written a driver for the TNT4882 Chip that is interfaced to the an SH3 Hitachi Risc processor. It is working but ever so often on long messages that I  transmit  I get a Timeout  Error on the  Host Computer (Listener).

First I Initialize the Chip  during Power On.
Set the Chip to ONE CHIP MODE (during initialization)
Software Reset
To  transmit I  do the following after the chip has been initialized.:
Reset the FIFO A and B Buffers
Set to WRITE (CFG Register) and 8 Bit Mode
Set the 2's Complement of the Counters (Cnt0 and Cnt1) for the number of bytes to transmit
Wait till the FIFO Buffers are cleared
Write in blocks of 32 bytes the data to FIFOB and count down internal defined byte counter.
Exit loop when counter reaches 0.
Wait till the FIFO Buffer is empty by checking the HR_NEF Flag.
Reset to Listener.

My questions are:
1. For short messages/strings that I transmit, all is well
2. When I start transmitting longer buffers of about 40 to 60 bytes, I start getting Timeouts on the Listener.
GPIB call ibrd  FAILED.  ibsta=0xc100, ibcnt=0x3c, iberr=EABO
I/O operation aborted (timeout)
3. When I analyze the data recieved, I usually see either all the bytes but the last one or 1 byte missing in the stream.
4. What could be the cause of this?
5. Can this be a purely hardware issue?
6. Am I outputting correctly to the GPIB?

7. Where can I get more information on how to transmit/recieve data. I only have the TNT488 programmers Reference book which has so many registers but doesn't give a flow of how to setup and run in an orderly method.

Thanks to anyone who is out there!!


0 Kudos
Message 1 of 6
(4,234 Views)
Hello Eytan:

Thank you for contacting National Instruments. Could you provide a spy capture from the host end? Also, an analyzer to check if the bytes are coming across the bus. Which version of NI-488.2 driver and what interface type are you using to communicate with the chip? I want to check if EOI is getting sent.
Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 2 of 6
(4,183 Views)

I found  some sample code on National Instruments' drivers page for GPIB.

You can download the zip file and it shows how to communicate and setup various types of writes using interrupts, DMA, and PIO.

Maybe this will give you the sample you need to verify your program.
http://digital.ni.com/softlib.nsf/websearch/A47F3CEA412F61C6862569EF00012F10?opendocument&node=13207...

-Lamb

Message Edited by Lambsauce on 04-30-2007 08:38 AM

0 Kudos
Message 3 of 6
(4,151 Views)


@Roland A. wrote:
Hello Eytan:

Thank you for contacting National Instruments. Could you provide a spy capture from the host end? Also, an analyzer to check if the bytes are coming across the bus. Which version of NI-488.2 driver and what interface type are you using to communicate with the chip? I want to check if EOI is getting sent.


Dear Roland,
Thanks for responding. If you send me your email I will send you a sample of the spy that I have running.
I don't have an analyzer and I am not sure where to get one/rent one.

The error code that I get is EABO and ibcntl is 0x30.

I have been able to improve the data transmission by adding a fixed char/byte delay for messages that are longer than 32  bytes long. This I add just before I tranfer a byte to the FIFO buffer. I picked 32 since this is the FIFO size. This slows the transmission tremendously, though at this point I am more concerned about data integrity.
 The Host 488 driver is  2.42
Sincerely yours,
Eytan
0 Kudos
Message 4 of 6
(4,138 Views)
Hello Eytan:

Is it possible for you to post the spy capture on the forum. Do you still get the timeout error after slowing down the transmission?
Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 5 of 6
(4,083 Views)


@Eytan wrote:
To  transmit I  do the following after the chip has been initialized.:
Reset the FIFO A and B Buffers
Set to WRITE (CFG Register) and 8 Bit Mode
Set the 2's Complement of the Counters (Cnt0 and Cnt1) for the number of bytes to transmit
Wait till the FIFO Buffers are cleared
Write in blocks of 32 bytes the data to FIFOB and count down internal defined byte counter.
Exit loop when counter reaches 0.
Wait till the FIFO Buffer is empty by checking the HR_NEF Flag.
Reset to Listener.

I think your problem may be your writing. You say that you:
1) Wait until the FIFO Buffers are clear - This sounds bad. Before you start a write, your buffers MUST be cleared. If you don't know they are clear, you can use the Reset FIFO command (in CMDR, I think).
2) You say you write in blocks of 32 bytes - This sounds bad too. The TNT in 8-bit mode has a 16-byte FIFO (in 16-bit mode it has a 16-word FIFO) If you write in blocks of 32, you could easily be overwriting some data, which means that you will not transmit all of the expected data. You should, instead, loop while reading teh FIFO Flags. If the flags say NFF, it is not FULL and you can write one byte. If it says INTSRC2, you know the FIFO is about 1/2 emtpy and you can write 8 bytes. If it says !NEF, then it is empty and you can write 16 bytes (if you have an old (rev A) TNT, you may want to only write 15 bytes).
3) You waitn until the Buffer is emtpy by thecking HR_NEF - I wouldn't do that either. You should wait for Done (which means that the byte has been taken out of the FIFO AND has been transferred across the bus).

Hope this helps.
0 Kudos
Message 6 of 6
(4,070 Views)