Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TNT5002, need applications help for development

I have developed an embedded system (32b ARM with RTOS) with a TNT5002 to provide IEEE 488.2 device functionality. The hardware has been quite well debugged by now, and I have code that initializes the TNT5002 chip in GEN488 mode and can do some rudimentary communications, take and process interrupts, etc. I have been programming the chip at the register level based on the TNT5002 Technical Reference Manual. What would really have been useful is an Applications Manual that might provide more guidance on the modes and programming. I am currently stuck with the problem of getting back into listen mode after sending a response to a query. My first cut was to go into talk mode and fill the FIFO as long as I had data. When seeing the DO (data out) interrupt I would set the IN bit in the CFG register. This worked sometimes but not always because I would not always get the DO interrupt at the end of the transfer. It looks like I could use isr3(DONE) in a similar manner but a quick hack/test showed that it worked differently but still not correctly. Can someone point me to some documentation, or example of register level programming, or describe what kind of interaction I need to implement to make the transfer manager work as intended ? Many thanks, George
0 Kudos
Message 1 of 9
(4,229 Views)
Gpontis,
 
I agree that the TNT5002 manual doesn't have everything quite there when it comes to the over-all big picture.  I have found that the TNT4882 manual, especially the parts about the big picture, fills this gap almost completely.  Chapter 4 goes into the preferred way to communicate and what interrupts to use when sending and receiving data. 
 
 
Also there is a software package that has C source code for communicating as a TNT4882 Talker/Listener.  This source implements the ideas expressed in the TNT4882 manual.  GPIB_IO.C will be where the actual communication with the chip takes place.  The source code package actually implements an API that is very similar to that of NI-488.2.
 
 
I hope this helps,
Steven T.
0 Kudos
Message 2 of 9
(4,212 Views)
Thank you very much for these pointers. I downloaded the two files and looked briefly at the Chap 4 and gpib_io.c. It will take me a few hours to more fully grasp the approach. This is exactly the sort of information that I needed.
0 Kudos
Message 3 of 9
(4,203 Views)
I am finding it hard going to reverse-engineer the TNT5002 from the TNT4882 source and docs. The TNT4882 sample source is quite PC specific and looks like it might take some doing to port to the 32b embedded system. Before I launch into that I am wondering if the TNT4882 source can be expected to run without modification on the TNT5002 ?
0 Kudos
Message 4 of 9
(4,165 Views)

Gpontis,

I just checked the register map on both the TNT5002 and the TNT4882.  The registers related to GPIB communication have the same offsets.  There are only a few differences, but this mostly deals with things other than the GPIB communication (enabling dma etc).  Using both the TNT4882 manual and the TNT5002 manual, you should be able to work through these few differences with no problems.

Let me know if you have any questions about it.

Steven T.

0 Kudos
Message 5 of 9
(4,144 Views)
I didi port the TNT4882 to my embedded system. It's not pretty but it does seem to work. I did not implement DMA support since I did not require it, and my target was so very much different from the PC architecture. I did use the interrupt capability and queues. The areas that required porting were the four TNT_In and Tnt_Out macros, and some portability issues due to byte-ordering (queue rd/wr functions). The code to set up, enable, and clear interrupts was also much different from the PC/DOS environment, but it was localized and pretty easy. What I was not able to do was to integrate it smoothly into the operating system. In particular, the queue handling would require a lot of work and avoidance of bitmapped global variables used to track and communicate queue state. It would be important to fix this to get to an event driven implementation. (the same goes for LabView) If I could wish for something that would make it easier to do a good job implementing a design based on the TNT5002, it would be a set of rather complete flowcharts. Even one just to show the interaction with the transfer manager. But much more complete than the bullet item list in the text. Some modern code, with OS-specific items compartmentalized, would be gravy. George
0 Kudos
Message 6 of 9
(4,109 Views)

George,

Thank you for your feedback.  I also think it is difficult to use these old examples since they are very OS specific, and even the OSes are out of date.

Please file a product suggestion to R&D by selecting product feedback in this link:
http://sine.ni.com/apps/utf8/nicc.call_me

I will be talking with them as well, but it would be nice to have a customer name and company to talk to them about.  The product suggestion will go directly to me when you fill out the form.

Thanks,
Steven T.

 

0 Kudos
Message 7 of 9
(4,083 Views)

Hi,guys
the file (GPIB_IO.C) motioned has no-longer exist.
could you please upload a new one?

0 Kudos
Message 8 of 9
(917 Views)

TNT5002, need applications help for development

0 Kudos
Message 9 of 9
(814 Views)