Helo,
for(i=0;i<10;i++) // send 10 frame
{
EP2_Buffer[0] =3;
EP2_Buffer[1] = i;
EP2_Buffer[2] =0xAA;
EndPoint_IN(EP2,64); <----------- error not send 10 frame
while( wait send frame....how do ?) <-------- what BIT ( CheckEndPoint___IN )
PTBD^=0x30; <----- test see error
}
solution....
EndPoint_IN(EP2,64);
while( wait send frame )
next frame....loop
how do CheckEndPoint___IN ( what it bit in bitmap all usb )
if not check not send all frames....
thanks,
Carlos,
解決済! 解決策の投稿を見る。
hi,
for(c=0;c<10;c++){ send 10 = 10 not failure
EP2_Buffer[0] =3;
EP2_Buffer[1] =c;
EP2_Buffer[2] =0xAA;
while( CheckEndPointIN2( )); checking = ok ,now runinng
EndPoint_IN(EP2,64);
PTBD^=0x30;
NOTE time interval = 15ms ( descriptor = 0 interval )
}
//----------------------------------------------------------------------------------------
UINT8 CheckEndPointIN2( void )
{
if(! EP2_Set.Stat.McuCtlBit.OWN)
return 0;
return 1;
}
//--------------------------------------------------------------------------------------------
packet bytes = interval 15ms
decreasing the time of 15 ms?
Tsuneo thanks,
Carlos,
> how do CheckEndPoint___IN ( what it bit in bitmap all usb )
Check the OWN bit of the BD (Buffer Descriptor) for the target IN endpoint.
On your code, EndPoint_IN() should set this bit to 1, when it passes the endpoint buffer to the SIE. When the SIE completes IN transaction, the OWN bit drops by the SIE.
Therefore, by polling this bit for the transition from 1 to 0, you know the completion of the transaction.
OR
- Poll TOKDNEF bit of INTSTAT. This bit raises when a transaction completes on one of endpoints.
- STAT register points the target endpoint, when a transaction finishes on this endpoint.
This method fits better for process by hardware interrupt, rather than polling.
The real code depends on the way how the stack declares BD.
Usually, stacks have a macro or a function to do this job.
What is the example, on which you are working?
Tsuneo
hi,
for(c=0;c<10;c++){ send 10 = 10 not failure
EP2_Buffer[0] =3;
EP2_Buffer[1] =c;
EP2_Buffer[2] =0xAA;
while( CheckEndPointIN2( )); checking = ok ,now runinng
EndPoint_IN(EP2,64);
PTBD^=0x30;
NOTE time interval = 15ms ( descriptor = 0 interval )
}
//----------------------------------------------------------------------------------------
UINT8 CheckEndPointIN2( void )
{
if(! EP2_Set.Stat.McuCtlBit.OWN)
return 0;
return 1;
}
//--------------------------------------------------------------------------------------------
packet bytes = interval 15ms
decreasing the time of 15 ms?
Tsuneo thanks,
Carlos,