|
Hi RSKV,
Thanks for your reply. I troubleshoot further and found the problem
WORD *Destination = (WORD *) (&EP6FIFOBUF);
The above line has the problem. If i don't use the above line and assign values directly to EP6FIFOBUF then the code works but it doesn't work when i try to cast EP6FIFOBUF to WORD.
What I am saying is that the following code works
void TD_Poll(void) // Called repeatedly while the device is idle
{
WORD i,j;
WORD count;
if(!(EP2468STAT & bmEP6FULL))
{ // check EP6 FULL(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is full
// loop EP2OUT buffer data to EP6IN
count = 0;
for (i=0;i<150;i++)
{
for (j=0;j<512;j++)
{
EP6FIFOBUF[j] = j;
}
EP6BCH = 0x02;
EP6BCL = 0x00;
count++;
}
}
But The above approach has two problems.
1. I want to send 16 bits of data. Since EP6FIFOBUF is an array of BYTE so I can't send it 16 bytes with it.
2. I looked in the example of CyStream where there second loop was 1024 bytes instead of 512 bytes. I rather send packet of 1024 bytes but when i do that in my host program I start to get garbage value after 512 bytes. Can you explain why it is happening? Will there be any speed advantage by sending 1024 bytes instead of 512 bytes?
Thanks for your support.
Regards,
Abhishek Madaan
|