I'm writing a linux driver for TNT4882 and met some problems when testing it. The TNT4882 is working in one chip mode, has only one address. I have a host PC with NI LabVIEW software and a PCI-GPIB card installed. I'm using the simplest GPIB read and GPIB write to test my driver. The data from TNT4882 can be successfully transferred to PC by a LabVIEW GPIB read. However, TNT4882 can't get any data from PC, in other words, I can't read data through TNT4882. When a LabVIEW GPIB write is issued, TNT4882 becomes an address Listener (TA bit set in ADSR) but NEF bit is always clear, indicating no data available in FIFO to read.
Currently I'm polling the NEF bit in ISR3 to conduct the data transfer from FIFO to RAM, although I have setup the interrupts. The following is part of the source code.
1. Initialization:
CMDR = 0X22;
SPMR = 0X80;
AUXMR = 0X80;
AUXMR = 0X99;
KEYREG = 0X00;
HESSEL = 0X01;
AUXMR = 0X02;
AUXMR = 0X51;
AUXMR = 0X00;
2. Set address to 10:
ADMR = 0X31;
ADR = 10;
ADR = 0XE0;
3. Read function initialization:
CMDR = 0x10; // Reset FIFOA and FIFOB
CFG = 1<<6 | 1<<5; // TLCHLTE =1, IN = 1, FIFOB Only
CNT0 = size & 0xff; // Transfer count
CNT1 = (size>>8) & 0xff;
CNT2 = (size>>16) & 0xff;
CNT3 = (size>>24) & 0xff;
IMR1 = 1<<4; // END IE = 1
CMDR = 0X04; // GO
4. Check ADSR to ensure TNT is an addressed listener -> yes
5. Check NEF bit in ISR3. If set, read data from FIFOB. -> hang here.
Could anybody help me or give me a hint here?
Thanks