daveh Guest
 
 
 
 
  
			
			
			
			
			
			
			
			
			
			
  
		  | 
		
			
				| USB problem when packet length is multiple of TX buffer size | 
			 
			
				 Posted: Wed Apr 22, 2009 10:12 am     | 
				     | 
			 
			
				
  | 
			 
			
				Hello, I'm using a PIC1865J50 to transmit packets via USB to a computer.  On the computer side I'm using a C++ program using Microchip's mpusbapi.  My program is a variation of Microchip's "Example 02 - Run-Time Linking".
 
 
My problem is this, when the computer receives a packet that is a multiple of the tx buffer size the program is ok the first time around, but subsequent attempts to receive cause an error.  My TX buffer is 64bytes, so a receive size of 511 works fine as does 513, but 512 fails.
 
 
I got the latest USB driver files from CCS and in USB.c it appears they correctly send a 0-length packet if the previous one was full.  I'm guessing Microchip's MPUSBRead() function isn't properly handling this.
 
 
Anyone see this problem before? | 
			 
		  |