Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

My GPIB card can't detcted by GPIB explorer ,what should I do.

I developed a GPIB card with TNT4882 and use it in One-chip Mode or 7210 Mode. I can read and write the TNT4882 register correctely. Now I have the following questions:
1   I connect my card with GPIB-USB-HS. Bus the GPIB explorer can't detect mycard (I use "scan for instrument" ).
2   I don't know how to deal with the following registers when I initialization TNT4882. Such as SPHR PPR IMR0 IMR1 IMR2 IMR3. how can I initial my card in serial poll.
3   Who can tell me the exact process on the GPIB bus  when I use "ibln" to find the listners on the bus.
4   How can I general a serial poll when I use GPIB explorer ?
 
What should I do as I am in this situation?
Thank you very much!
0 Kudos
Message 1 of 15
(5,049 Views)
1   I connect my card with GPIB-USB-HS. Bus the GPIB explorer can't detect mycard (I use "scan for instrument" ).
The scan for instruments algorithm will send a listen address (MLA) and the unassert ATN and check the status of the NDAC line. If a device detected its listen address it will be asserting NDAC. If no device detected its listen address NDAC will be unasserted. A common error is that the TNT4882 has the same GPIB address as the controller, usually 0. The TNT4882 must have a different GPIB address. Also, pon must be cleared in the TNT4882.

2   I don't know how to deal with the following registers when I initialization TNT4882. Such as SPHR PPR IMR0 IMR1 IMR2 IMR3. how can I initial my card in serial poll.
You are essentially asking how to write a driver for the TNT4882. This is not trivial but can be done and lots of customers have done it. I have two suggestions. Have you looked at the TNT4882 and TNT5002 programming manuals? The TNT5002 and TNT4882 are register compatible. The TNT5002 manual gives better instructions for programming which also apply to the TNT4882.

3   Who can tell me the exact process on the GPIB bus  when I use "ibln" to find the listners on the bus.
The ibln command is similar to scan for instruments. It sends a listen address then unasserts ATN and checks the state of the NDAC line.

4   How can I general a serial poll when I use GPIB explorer ?
I'm not sure I understand this one. Do you want to serial poll the TNT4882 from the host? One way would be to use the ibrsp command through ibic or in your own program. ibic is useful for communicating to the TNT4882 while troubleshooting and developing code.

Message 2 of 15
(5,015 Views)

HI Collin, Thank you very much

I read some messages that you have sent before.

 Now , my instrument explorer have detected my card. But my card did not send "*IDN" to the CIC.

Addition,I have the following questions:

1 How can I do if I want send "*IDN" to CIC?

2 Can I work with TNT4882 without any interrupt?

3 If I do not use DMA, dose the rate of data transmit fall so much?

thank you  

0 Kudos
Message 3 of 15
(5,001 Views)
An other question:
There are many hidden register in the TNT4882. Can I complete the data transmit (read and write) without using these register.
Because I don't know how to access these register.
Thanks! 
0 Kudos
Message 4 of 15
(4,990 Views)

1 How can I do if I want send "*IDN" to CIC?

Receiving *IDN and replying are normal data transfers, no different than sending or receiving other data. I recommend reading the GPIB Transfer Manager starting on page 4-11 in the TNT5002 manual. It would not be practical to explain the entire process here. The TNT5002 manual lists all the steps required for a transfer. Even though you are using the TNT4882 the TNT5002 manual applies as the two are register compatible.

2 Can I work with TNT4882 without any interrupt?

You can not enable interrupts in the IMRs and just poll the ISRs. However interrupts will be easier to work with. If you don't enable interrupts the host processor is going to spend a lot of time polling the ISRs. When there is a change to the TNT address state (becoming a talker or listener) a transfer is usually set up. The easiest way to detect a change in addressing state is with interrupts.

3 If I do not use DMA, dose the rate of data transmit fall so much?

Yes it does. However, even with DMA the transfer will be limited to a little over 1MB/s. Without DMA it will probably be a few hundred kB/s. Not implementing DMA will probably be sufficient for most applications as the amount of data transferred is relatively small. If you are only transferring a few hundred bytes or so it should not matter if you don't implement DMA.


The hidden registers in the TNT4882 aren't really hidden and they are easy to access. I'll use AUXRA as an example. AUXRA is at offset 0x0A and AUXMR is also at 0x0A. To write to the AUXRA you simply need to write a '1' for bit 7 and '0' for bits 5 and 6 along with the actual bits you want to set. Writing the same bit pattern to AUXMR is undefined. The TNT will always know which register you are writing by examing the data as well as the address. So if you want to set the BIN and REOS bits in AUXRA you would write 0x94 to offset 0x0A. If you want to write CHIP_RST to the AUXMR you would write 0x02 to offset 0x0A.

Message 5 of 15
(4,985 Views)
HI Coliin, Thank you very much for your reply. I think I have much work to do before I can get reply by seding "*IDN" to TNT4882.
 
Now I am trying to read data from CIC by following the steps which are shown in "ESP-488TL Software reference manual for TNT4882"(chapter 6 6-14),
 
I can complete step1 and step 2, But when excute the step3, the DONE bit in register ISR3 is never set. I don't know why.
 
I think it was caused by Setup_TNT_IO(). I copied this founction from ESP-488TL, and set it in "Input_byte" mode.
 
following is my code for read data from CIC:
 
//void readdata()
//{
// char test;
// int mr_isr3;
// char data;
// unsigned long int *count_sent;
// Set_Timeout(15,TRUE);
// while(1)
// {
//  if((TNT_In(R_adsr) & B_la)==0x04)     //判断是否有读请求
//  break;
// } 
// Setup_TNT_IO(INPUT_BYTE,50,EOI);
//
// while(1)
// {
//  test=TNT_In(R_isr3)&B_done;
//  if((TNT_In(R_isr3)&B_done)==0x01)
//   break;
//  if((TNT_In(R_isr0)&B_to)==0x20 && ((TNT_In(R_isr3)&B_nef)==0x04))
//   break;
//  mr_isr3=TNT_In(R_isr3);
//  if((mr_isr3&B_nef))
//   data=TNT_In(R_fifob);
// }
//
// DONE_Handler(INPUT_BYTE,&count_sent);
//}  
0 Kudos
Message 6 of 15
(4,972 Views)

Addition information:

when I press "write" botton , It display like this

When I excute the TNT_Out(R_cmdr,F_rhdf) in Setup_TNT_IO(), it immediately go back to (the following PIC), without any information feedback.

0 Kudos
Message 7 of 15
(4,970 Views)
Hi, Collin. I did some experiments these days,
I found that the ISR3 never changes both in reading and writting. always 0x00.
 
And when I use NI spy to capture the action, It always shows "ibwrt(udo, "6", 1, 0x01)    0x01000    0"
but in my code, it receive nothing, because :
 
if(mr_isr3 & B_nef)   ------------------------------------this requirement is never satified  (mr_isr3=TNT_In(R_isr3)   always 0x00)
{
   *(buf)=TNT_In(R_fifob);
}
 
0 Kudos
Message 8 of 15
(4,957 Views)
Can you send me the source code to the function Setup_TNT_IO(INPUT_BYTE,50,EOI) referenced above?

Also, when the code is running and expecting a bit in ISR3 to set, can you read the following registers and report the results: SASR, STS1, STS2, ISR0, ISR1, ISR2?

ISR3 is a read-only register. A different writeable register exists at the same offset.


Message 9 of 15
(4,945 Views)

I have read the following registers :

sasr--------------------------0x00

sasr2------------------------0x00

sasr3------------------------0x00

sts1-------------------------0x3b

sts2-------------------------0x9b

isr0--------------------------0x07

isr1--------------------------0x00

isr2--------------------------0x93

and the following is my code of Setup_TNT_IO(),it just copy from ESP-488

void Setup_TNT_IO(int io_type, unsigned long int cnt, int term)
{
 int testa;
  unsigned long int twos_cnt=-cnt;        /* Obtain the twos compliment cnt */
  Requested_Count=cnt;                    /* Save requested transfer cnt    */

  TNT_Out(R_cmdr,F_resetfifo);            /* Reset TNT fifos                */

#if(USE_DMA)                              /* If using dma enable dma on     */
  TNT_Out(R_dmaenable, F_dmaon);          /*  the evaluation board          */
#endif

  TNT_Out(R_cnt0, (char)(twos_cnt));      /* Load twos compliment count     */
  TNT_Out(R_cnt1, (char)(twos_cnt>>8));   /*  into TNT count registers      */
  TNT_Out(R_cnt2, (char)(twos_cnt>>16));
  TNT_Out(R_cnt3, (char)(twos_cnt>>24));
       /* If using timeouts              */
  if(Timeout.factor_index>0) {            /*   Set B_to bit and maybe B_bto */
    TNT_Out(R_imr0,B_glint|B_to|((Timeout.byte_timeout)?B_bto:0));
    TNT_Out(R_auxmr,HR_auxrj|Timeout.factor_index); /* Set time             */
  }
  else {
    TNT_Out(R_imr0,B_glint);              /* Set write to imr0 to be sure   */
    TNT_Out(R_auxmr,HR_auxrj|0);          /*   B_to is cleared              */
  }

  switch(io_type) {                       /* Switch to input or output      */

    case INPUT_BYTE:
      TNT_Out(R_imr1, B_end);     /* End transfer on eoi or eos     */

      TNT_Out(R_eosr, READ_EOS_BYTE);     /* Set eos byte                   */
      TNT_Out(R_auxmr,HR_auxra|F_hlde|((term&EOS)?B_endoneos:0));
       /* Configure for byte input       */
   testa=F_input_config&~B_16bit;
      TNT_Out(R_cfg , (F_input_config&~B_16bit));
       /* Holdoff on end & enable eos    */
   TNT_Out(R_cmdr, F_go);              /* Start transfer state machine   */
   TNT_Out(R_auxmr,F_rhdf);            /* Release holdoff                */
           
      break;

    case INPUT:

      TNT_Out(R_imr1, B_end);     /* End transfer on eoi or eos     */

      TNT_Out(R_eosr, READ_EOS_BYTE);     /* Set eos byte                   */
      TNT_Out(R_auxmr,HR_auxra|F_hlde|((term&EOS)?B_endoneos:0));
      TNT_Out(R_cfg , F_input_config);    /* Configure for word input       */
       /* Holdoff on end & enable eos    */
   TNT_Out(R_cmdr, F_go);              /* Start transfer state machine   */
   TNT_Out(R_auxmr,F_rhdf);            /* Release holdoff                */
          

      break;

    case OUTPUT:
      TNT_Out(R_imr1, B_err);     /* End transfer on err            */

      TNT_Out(R_eosr, WRITE_EOS_BYTE);    /* Set EOS byte                   */
       /* Holdoff on all & enable EOS    */
      TNT_Out(R_auxmr,HR_auxra|F_hlda|((term&EOS)?B_xeoiweos:0));
       /* Configure for word output      */
      TNT_Out(R_cfg , F_output_config|((term)?B_ccen:0));
      TNT_Out(R_auxmr,F_hldi);            /* Hold off immediately           */
      TNT_Out(R_cmdr, F_go);              /* Start transfer state machine   */
      break;

    default:
      Generate_Error(EARG);               /* If io_type incorrect issue EARG*/
      break;
  }
}

0 Kudos
Message 10 of 15
(4,939 Views)