- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Hello i am sending known pattern of 512 bytes through endpoint 6 from fx2lp to host.
i am adding count variable in the every 512 bytes transfer and making count increment.if i look at this count in the host side,i am not recieving proper count increment.i am requesting 51200 bytes in one TRANSFERIN button in the control center.count bytes are missing in the middle.please find the below code example and test patern recieved in the host.why some bytes are failed to commit to host?
int count=0;
BYTE Test_data;
void TD_Init( void )
{
CPUCS = 0x02;
SYNCDELAY;
// IFCONFIG = 0x03;
/*Commented,default port mode*/
}
void TD_Poll( void )
{
FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY;
EP6FIFOCFG = 0x00; //switching to manual mode
SYNCDELAY;
for(loop=0;loop<512;loop++)
{
EP6FIFOBUF[loop] = Test_data;
SYNCDELAY;
Test_data++;
}
EP6FIFOBUF[511]=count;
SYNCDELAY;
count++;
EP6BCH=0x02; //512 bytes committed
SYNCDELAY;
EP6BCL=0x00;
SYNCDELAY;
FIFORESET = 0x00; //Release NAKALL
Test_data=0x00;
}
regadrs,
geetha.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Geetha,
Please use the following code snippet for TD_Poll()-
void TD_Poll( void )
{
FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY;
EP6FIFOCFG = 0x00; //switching to manual mode
SYNCDELAY;
if(!(EP2468STAT & bmEP6FULL))
{
for(loop=0;loop<512;loop++)
{
EP6FIFOBUF[loop] = Test_data;
SYNCDELAY;
Test_data++;
}
EP6FIFOBUF[511]=count;
SYNCDELAY;
count++;
EP6BCH=0x02; //512 bytes committed
SYNCDELAY;
EP6BCL=0x00;
SYNCDELAY;
FIFORESET = 0x00; //Release NAKALL
Test_data=0x00;
}
}
Best Regards,
Sananya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Geetha,
Please use the following code snippet for TD_Poll()-
void TD_Poll( void )
{
FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY;
EP6FIFOCFG = 0x00; //switching to manual mode
SYNCDELAY;
if(!(EP2468STAT & bmEP6FULL))
{
for(loop=0;loop<512;loop++)
{
EP6FIFOBUF[loop] = Test_data;
SYNCDELAY;
Test_data++;
}
EP6FIFOBUF[511]=count;
SYNCDELAY;
count++;
EP6BCH=0x02; //512 bytes committed
SYNCDELAY;
EP6BCL=0x00;
SYNCDELAY;
FIFORESET = 0x00; //Release NAKALL
Test_data=0x00;
}
}
Best Regards,
Sananya