|
happy new year to everyone glad to help,
I just add the configuration of the EP2 which had not used.
but now I don't think I have solved the problem because it happened again. Acctually, it very strange, it works on previous board but it does not work on the new board( there's not any difference between two board except their birhday), what's more, when I changed the code
(code 1)
if(!(EP2468STAT & bmEP4EMPTY))
{
{
//count = ((EP4BCH << 8) + EP4BCL) & 0x03FF;
count = (EP4BCH << 8) + EP4BCL;
cmd=EP4FIFOBUF[0];
// loop EP4OUT buffer data to EP8IN
for( i = 0x0000; i < count; i++ )
{
// setup to transfer EP4OUT buffer to EP8IN buffer using AUTOPOINTER(s)
RAMBUF(0x200+i)=EP4FIFOBUF[i];
}
RAMBUF(0x3FE) =1;
SYNCDELAY;
SYNCDELAY;
OUTPKTEND=0X84;
}
to
(code 2)
if(!(EP2468STAT & bmEP4EMPTY))
{
{
count = ((EP4BCH << 8) + EP4BCL) & 0x03FF;
// count = (EP4BCH << 8) + EP4BCL;
cmd=EP4FIFOBUF[0];
// loop EP4OUT buffer data to EP8IN
for( i = 0x0000; i < count; i++ )
{
// setup to transfer EP4OUT buffer to EP8IN buffer using AUTOPOINTER(s)
RAMBUF(0x200+i)=EP4FIFOBUF[i];
}
RAMBUF(0x3FE) =1;
SYNCDELAY;
SYNCDELAY;
OUTPKTEND=0X84;
}
or to
(code 3)
if((!(EP2468STAT & bmEP4EMPTY))&&(count>0) )
//if(!(EP2468STAT & bmEP4EMPTY))
{
{
//count = ((EP4BCH << 8) + EP4BCL) & 0x03FF;
count = (EP4BCH << 8) + EP4BCL;
cmd=EP4FIFOBUF[0];
// loop EP4OUT buffer data to EP8IN
for( i = 0x0000; i < count; i++ )
{
// setup to transfer EP4OUT buffer to EP8IN buffer using AUTOPOINTER(s)
RAMBUF(0x200+i)=EP4FIFOBUF[i];
}
RAMBUF(0x3FE) =1;
SYNCDELAY;
SYNCDELAY;
OUTPKTEND=0X84;
}
It works. I can't find any expaination on EZ-USB® Technical Reference Manual, wish helps,thanks.
(remarks: the difference between code 1 and 2 is the green part; code 1 and 3 is the yellow part)
|