USB CDC Speed

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB CDC Speed

1,513件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by togi on Mon Apr 16 04:46:45 MST 2012
Hello,

I use a CDC USB connection on a LPC Xpresso 1769 board to send meassurment values to the PC. How can i change the transfer speed of the device? when i count the received bytes i have a receive frequency around 700Hz or 700Byte/s.

Thanks for help.

Greetings Tom
0 件の賞賛
返信
5 返答(返信)

1,280件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Apr 16 07:20:18 MST 2012

Quote: togi
I count the symbols i receive in a certain time. My controller runs with about 1MHz. I meassures this over a GPIO which i toggle. But when i try to send a symbol every cycle the maximum rate is only about 700 symbols per second.

:confused:

Sorry, I don't understand that :(

What is a symbol? A byte?
Your controller is running with 1MHz? I would guess that's your loop?

Do you know how USB is working? As mentioned above Host is reading a Frame every ms. So it's your job to fill the endpoint buffer :eek:

If your buffer is filled with 1byte your host is reading max 1000 bytes/second, regardless if your loop is running with 1MHz or 100GHz :eek:
0 件の賞賛
返信

1,280件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by togi on Mon Apr 16 06:56:18 MST 2012
I count the symbols i receive in a certain time. My controller runs with about 1MHz. I meassures this over a GPIO which i toggle. But when i try to send a symbol every cycle the maximum rate is only about 700 symbols per second.
0 件の賞賛
返信

1,280件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Apr 16 06:47:36 MST 2012
And you are transmitting what?

700 times per second 1 byte?
0 件の賞賛
返信

1,280件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by togi on Mon Apr 16 06:40:47 MST 2012
Thanks for the fast reqly :-)
I use the example USBCDC from nxp. But i can´t find the wMaxPacketSize i only find a define "USB_MAX_PACKET0" in usbcfg.h. This was define with a 8. I change it to 64 but the speed didn´t change. The define is load in LPC_USB->USBMaxPSize after a usb reset.
0 件の賞賛
返信

1,280件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Apr 16 05:26:00 MST 2012

Quote: togi
...receive frequency around 700Hz or 700Byte/s  :confused:



Then change your code :)


Quote:

[B]Maximizing Performance[/B]

        These guidelines can improve performance of device firmware:
      For full-speed devices, set wMaxPacketSize in the bulk  endpoint  descriptors to 64 to enable transferring the most data possible in   each USB transaction. [COLOR=Red]With a UHCI host controller, if a full-speed bulk   endpoint’s wMaxPacketSize is less than 64, the host controller  schedules no  more than one transaction per millisecond for the  endpoint.[/COLOR] (Full-speed host  controllers comply with either the OHCI or  the UHCI standard. Many PC  motherboards contain UHCI controllers.)  High-speed bulk endpoints must set  wMaxPacketSize = 512.
      To transfer large amounts of data to the host as quickly as   possible, use wMaxPacketSize data packets. Larger packets mean fewer   transactions are needed to transfer the data.

See: http://www.lvr.com/usb_virtual_com_port.htm
0 件の賞賛
返信