Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB-TNT4882 ASIC

ASIC TNT4882

I'm interfacing the ASIC to a microcontroller (MCU)  40Mhz, 8 bits bus
width.
The user end application may send a string longer  than 16 bytes.

I don't want the ASIC to interrupt the  microcontroller on each byte
received.

For example I programmed the ASIC to  interrupt the MCU due to END RX,
or EOS and it worked for me as long  as the
sender is sending string no longer than 16 bytes.  If the sender is sending

more then 16 bytes, I do not get an  interrupt.

How can I handle more than 16 bytes string   sent by user appilcation at a

time using interrupt. Is there any option  for if the buffer is FULL "16
bytes"
it generates  an interrupt. Again interrupt on each byte received is taking
the
MCU  time.

Please give me the best way?
0 Kudos
Message 1 of 8
(4,519 Views)
Do you have the capability to implement DMA between the TNT4882 and processor by using the DRQ and DACK pins? This would allow the processor to transfer an arbitrary number of bytes from the TNT4882 without ever interrupting, if the processor supports this. DRQ from the TNT4882 will assert whenever there is data in the TNT4882 FIFOs during a read.
0 Kudos
Message 2 of 8
(4,509 Views)
Mr. Collin, thank you. 
 
I do  not  have the capability to implement DMA between the TNT4882 and processor by using the DRQ and DACK pins.
0 Kudos
Message 3 of 8
(4,476 Views)
If you can't use DRQ/DACK then you must use interrupts (or polling). Look at ISR3 bit 6, FIFO_RDY. In the case of a the TNT4882 receiving data this bit will set when the FIFO is at least half full (8 elements). You can either poll on this bit or set it to cause an interrupt. You can also use the NFF and NEF bits in the same register to determine the state of the FIFOs.

0 Kudos
Message 4 of 8
(4,468 Views)

Mr. Collin, thank you,

In the case of a the TNT4882 receiving data, bit ISR3[6] will set when the FIFO is at
least half full (8 elements). Assuming I'm going to use an interrupt and assuming the
string is greater than 8 characters, what the sequence of actions I should do after the
interrupt occurred to insure getting the complete string "more than 8 characters".
As I stated previously  the string could be more than 16 characters.

0 Kudos
Message 5 of 8
(4,466 Views)
Well, the bit I mentioned (ISR[6]) will set each time there is data to read from the FIFO. The sequence of actions after detecting the interrupt would be to read the appropriate number of elements out of the FIFO and wait again for ISR[6] to set. Of course, you might get the END interrupt before you get another 8 bytes so you will need to check for that also. ISR[6] will keep setting as the TNT4882 receives more bytes.

So, a basic algorithm looks like this

wait for ISR[6] or EOS
{
    if ISR[6] is set
       read from FIFO and wait for ISR[6] or EOS again
   
    if END is set
       read any remaining data from FIFO then do something else.
}
0 Kudos
Message 6 of 8
(4,459 Views)
Mr. Collin, Thank you very much.
 
I would work on this a week from today and I let you know the progress.
0 Kudos
Message 7 of 8
(4,456 Views)
Shamsan, glad I could help.

I'm not the firmware expert here so if anyone else has comments please feel free to contribute.
0 Kudos
Message 8 of 8
(4,449 Views)