Hi
i am developing a USB - GPIB converter using TNT 4882. While sending & receiving data trou tnt 4882, i am loosing 4 / 12 bytes of data for every 65536 bytes transmitted or received.i couldnt figure out what is creating the data loss. here is the code which receives data from a cypress USB chip.
i am using DMA mode of transfer
IOA = (R_fifob << 1) | 0x40; // initialize other pins CS, ADDR, ABUS, BBUS,
if( GPIFTRIG & 0x80 ) // if GPIF interface IDLE
{
if((GPIFREADYSTAT & 0x02) != 0) // check for DRQ FIFO not full
{
SYNCDELAY;
GPIFTCB1 = (char) (cnt >> 8); // setup transaction count
SYNCDELAY;
GPIFTCB0 = (char) (cnt);
SYNCDELAY;
USB_Rec_Bytes += cnt;
EP2BCL = 0; // manual commit
SYNCDELAY;
GPIFTRIG = GPIF_EP2; // launch GPIF FIFO Write Transaction from EP2 FIFO
SYNCDELAY;
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 GPIF Done bit
{
if(Interrupt_Occured)
{
GPIFABORT = 0xFF;
Interrupt_Occured = FALSE;
}
}
SYNCDELAY;
}
}
}
can any one expalin what is going wrong & the possible solutions.
With Thanx & regards
Sreedhar