| Author | beginning argument ( Replies received: 3 ) |
| daniel2 |
Posted 07-07-2008 at 20:15   |

Registered on : 12-13-2008
Messages : 32
OFF-Line
|
I've looked through the demos, and none cover this issue.
I am using the VCOM example as my base, and I am trying to get around 500kb/sec transfer rates. I do not have an UART on the other end (I stripped that out).
The problem I have is that I do not seem to be able to send more than 64 bytes per frame. I know that with a full speed bus I should be able to get 19 packets per frame, or 64*19= 1.216Mb/sec
I have tried re-loading my endpoint on EP1_IN_Callback with more data, but that still didnt work. I have a fifo where I load 256bytes at a time for test, and here is my code for my endpoint callback
void EP1_IN_Callback(void)
{
char length;
char i=1;
if(fifo.num_free //we still have data to write on this endpoint, write it.
length= read_fifo(&fifo,&us0_tx_buf[0],64);
UserToPMABufferCopy(&us0_tx_buf[0], ENDP1_TXADDR, length);
SetEPTxCount(ENDP1,length);
SetEPTxValid(ENDP1);
}
count_in =0;
}
But that does not work. Any suggestions on how to get my data rates increased above the 64k? Thanks
Daniel
|
|
|
Profile
Quote
|
| daniel2 |
Posted 07-07-2008 at 20:16   |

Registered on : 12-13-2008
Messages : 32
OFF-Line
|
I should add this is on a STR911 part.
|
|
|
Profile
Quote
|
| daniel2 |
Posted 18-08-2008 at 20:06   |

Registered on : 12-13-2008
Messages : 32
OFF-Line
|
Just as an informational post on my findings on how to get full bandwidth.
You can increase the maxpacketsize in the descriptors of the VCOM (they are by default set at 64bytes - the same as the max packet data size). I don't know if you could actually transfer 1k of data on each packet given that the PMA is only 512bytes, so 512bytes was what I set things to (and allowed the bandwidth I needed). So this would theoretically allow up to 512kb/sec transfer rate, or around half the bandwidth of the USB bus.
If you use single endpoint buffers, you can only get one transmission out, you will only be able to use every other USB transaction, limiting you in this scenario to 256kb/sec (which for me was under where I wanted to be).
Enabling double buffered endpoints allowed me to transfer data every ms, and to give me the bandwidth necessary.
Cheers
Daniel
|
|
|
Profile
Quote
|
| rgreenthal |
Posted 11-09-2008 at 23:21   |

Registered on : 02-07-2008
Messages : 43
OFF-Line
|
Did you use the command
where
#define USBTXBUFFER_SIZE 512 // Note: MUST Match usb_desc.c size for ENDPOINT 6
// set Double Buffer register for larger packets
SetEPDblBuffCount(ENDP6, EP_DBUF_IN, USBTXBUFFER_SIZE);
Whole setup for End Point 6 IN (Tx to PC)is
SetEPType(ENDP6, EP_BULK);
SetEPTxAddr(ENDP6, ENDP6_TXADDR1);
SetEPTxCount(ENDP6, USBTXBUFFER_SIZE); // Set Count & BLsize
SetEPRxStatus(ENDP6, EP_RX_DIS);
SetEPTxStatus(ENDP6, EP_TX_NAK);
SetEPAddress(ENDP6,6);
// New
// set Double Buffer register for larger packets
SetEPDblBuffCount(ENDP6, EP_DBUF_IN, USBTXBUFFER_SIZE);
|
|
|
Profile
Quote
|