Martin, > thanks for your clarifications ! But i still have no clue how > to solve my problem: > > First to answer your questions: > It is logical endpoint 5, physical endpoint 11, bulk, which i > want to use with packet size of 64 bytes. Perhaps also with > double buffering if needed. Ok. > In usbhw.c inside interrupt routine, there is the following code: > > eisr = EP_INT_STAT; /* Endpoint Interrupt > Status */ > > In this variable eisr, there are two field EP5RX and EP5TX. > And when reading the datasheet, it looks to be the EP5TX, > which i need to use to send new data from device to host over > endpoint 5. In fact when i have understand the code correcly, > the set bit EP5TX triggers a call to USB_P_EP[m](USB_EVT_IN) > which is remapped to the function void USB_EndPoint5 (DWORD > event) (located in usbuser.c) which i mentioned in my > previous email (see below). Ok. > But this function is only called > around 975 times per second, which limits my throughput to > 975 / 1 s * 64 bytes = 62400 bytes / s. Is it the right bit i > am using or is there another way ? How heavily laden is your bus? The only way to know what's going on is to get yourself a *hardware* USB analyzer. I've tried the software ones and they are nowhere near as useful as the hardware one I have. > I think the triggering via > "IN token" was a misunderstanding (because of switch-case > USB_EVT_IN) ? USB_EVT_IN probably means "load some data ready to transfer to the host", i.e. the IN buffer is empty and you need to load it so the next IN token doesn't get a NAK response. > Could it be that my code inside PC is reading the data to > slow ? Currently i am triggering a > > length_status = usb_bulk_read(current_handle, 0x85, > ReceiveBuffer, 64, 1000); > > in a while loop (endless) inside the usb receiver thread. All > this runs in user mode. Can i increase the 64 bytes to > something higher even when LPC2148 only supports a max packet > size of 64. So is there a need that these values match ? I can't tell you anything about the host end, I've no idea what usb_bulk_read does for you or how it interacts with the OS stack. > How can i determine which side makes the problems in throughput ? Invest in a USB analyzer. There is no other way. You can see what's happening on the bus and make a diagnosis from what you see. Alternatively, invest in a USB stack that's already written? -- Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk CrossWorks for MSP430, ARM, AVR and now MAXQ processors
Message
RE: [lpc2000] USB with LPC2148: When to fire a new data transfer from device to PC (bulk endpoint) ?
2005-10-05 by Paul Curtis
Attachments
- No local attachments were found for this message.