Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB help needed

I'm developing driver for GPIB device TNT4882. I'm working at One Chip mode with ISA connection. I can read and write to all registers, but I have some problems/questions (see below).



1) I connected the TNT4882 to the PC with GPIB cable. I tried to use Measurement & Automation Explorer to communicate with the instrument, but no instrument was found during "Scan for instruments". We saw IFC, ATN, NDAC and Data GPIB bus lines changes during the scan. Nothing also arrived at TNT4882's FIFO. Can you please give me more information how PC discovering new devices and what should be done by the driver in order to allow to PC establish communication. May be I'm missing some timer configuration?



2) I performed Interrupt Test (as was suggested at NI's Application Note 095). I saw that all registers change their values exactly as they supposed to do (including SRS3 NEF bit) , but the INT pin didn't change to 1 and as a result I didn't have an interrupt.



3) I performed BSR & DCR Test (as was suggested at NI's Application Note 095). I wrote values to the registers, but read the entire tome 0's instead of written values. Does it OK?



4) I read 0 at CSR register. According to Application Notes the high byte shoul be 0011. I saw at one of your examples that if I get 0 it's mean that I'm using NEC7210 chip (and we indeed use 7210 mode), but it is not supported. Can you please explain a little more what exactly not supported?



5) I performed read/write simulation (wrote "hello" to FIFO and then read it back). I wrote two's complement of 5 to the CNT0, but the value didn't change during writing operation nor during reading operation. Does it OK? Should counter register change only when it read by controller or CPU?



6) According to Application Notes, I can't use CDOR/DIR registers at One Chip mode. Is it correct?







Interrupt Test



nSetVal = 0x1;

nRegister = INTR;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//Enable ISA interrupts by writing to INTR

nSetVal = 0x00;

nRegister = IMR0;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//clear IMR0

nRegister = IMR1;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//clear IMR1

nRegister = IMR2;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//clear IMR2

nRegister = IMR3;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//clear IMR3



nRegister = CMDR;

nSetVal = 0x10;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//clear FIFO

nRegister = ISR3;

bRet= m_GPIBdrv.GetGPIBHandle()->ReadRegister(nRegister, &nRetVal);//Read ISR3

nRegister = IMR3;

nSetVal = 0x4;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//Enable NEF IE

nRegister = FIFOB;

nSetVal = 0xaa;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//Write 0xAA to FIFOB

nSetVal = 0x55;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//Write 0x55 to FIFOB

nSetVal = 0x18;

bRet = m_GPIBdrv.GetGPIBHandle()->WriteRegister(nRegister, nSetVal);//Write 0x18 to FIFOB



nRegister = ISR3;

bRet= m_GPIBdrv.GetGPIBHandle()->ReadRegister(nRegister, &nRetVal); //Read ISR3





Best Regards






Alex Volkov

Software Engineer



Sysmop Technologies Ltd.

Tel: +972-4-9935088

Fax: +972-4-9937059



e-mail: alex@Sysmop.com
0 Kudos
Message 1 of 4
(3,992 Views)
Alex,

I am currently working with your Branch's Applications Engineer to get this problem resolved as quickly as possible. I will maintain contact you through your local National Instruments branch.

One of my main concerns right now is that your CSR register isn't returning the correct value. This tells me that there is a low-level problem since this register should not return 0. Has this changed at all since we started looking at this problem?

Also, I you said that you are using 7210 mode and also one chip mode. You later clarified that you are using one chip mode, and so I will assume that your mention of 7210 mode was a mistake.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,992 Views)
Scottie,

I still get 0 at CSR registers. I can read data from all other registers without problem, except BSR/DSR register that I also get 0 all the tim no matter what I write to them.

The most important thing we do not understand is how PC(with MAXes scan for device command) recognize TNT4882 chip. As I understand it, CIC asserts IFC and ATN lines and waiting that chip will assert NDAC line. My question is if the control lines asserts/deasserts autamatically by the chip or I need to do it manually in my software?

Also, can you please tell us where we can find TNT5004 datasheet and exact GPIB connector pinout?

Thank you very much and best regards,
Alex
0 Kudos
Message 3 of 4
(3,992 Views)
Alex,

Your control lines from your chip should assert and deassert automatically once the chip is configured for a GPIB address and the initialization routine has finished. I sent an e-mail to your branch regarding some problems on your schematic that could be causing your register read/write difficulties.

A good place to find datasheets and manuals is here:
http://www.ni.com/support/gpib/reg_prog.htm

The GPIB Connector pinout is here:
http://digital.ni.com/public.nsf/websearch/9BB2417C09C4D08786256BE9007D7B55?OpenDocument

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,992 Views)