Tech Support > Computer Hardware > Microprocessors > Achieving practically possible maximum speed for USB2.0
Achieving practically possible maximum speed for USB2.0
Posted by Himz on May 15th, 2006


Hello All,

I have been successful in implementing the USB2.0 communication
protocol for ISP1582 USB Peripheral Controller. With my current code I
am able to achieve the data rate of only 24Mbits/sec, which is too less
comparable to the actual data rate that can be practically achieved. I
request for your support and valuable suggestions in achieving the
maximum possible data rate. Before listing my doubts let me jot down
the ISP1582 configuration I am working with and all that I have tried
on my side to achieve a better rate.
ISP1582 USB Peripheral Controller Configuration is as follows:
Number of Enabled Pipes :- 02, ENDPOINT1IN and ENDPOINT1OUT
Type of Data Transfer Selected :- BULK
Type of Interrupt :- Active Low / Edge Triggered(Level Triggering also
tried, but no effect)
Buffer Type :- Double Buffering(Single Buffering also tried, but no
effect)
Setting of Various Registers :- MODE REGISTER -> 0x0D
INTERRUPT CONFIGURATION REGISTER -> 0x68
INTERRUPT ENABLE REGISTER -> 0x0000D3B9
DMA CONFIGURATION REGISTER -> 0x00
DMA HARDWARE CONFIGURATION REGISTER -> 0x00
Currently I am not using DMA.
Setting of Enabled EndPoints :- ENDPOINT1IN -> Maximum Packet Size is
512Bytes, Transfer type is Bulk and Double Buffering disabled
ENDPOINT1OUT -> Same as ENDPOINT1IN
I have also tried with single buffering.
With all these settings I am achieving the data rate of 24Mbits/sec.
Now, in order to increse this value I did the following exercises:-
1) Earlier the processor which I have interfaced to ISP1582 USB
Peripheral Controller had 3 wait states. That is the read/write cycle
for the external read or write is extended by 10nsec for one wait state
inserted. I reduced the wait states from 3 to a single wait state which
is the minum possible that I can afford for getting the chip
enumerated. Reducing further fails the enumeration process.
2) Next, I have written the complete code in C language. I converted
the two main functions that are being called many a times(i.e. the read
and write from the ISP1582 USB Peripheral Controller Buffer) from C to
Assembly. This also didn't help.
3) While sending the data from internal memory of processor to the
host PC via USB, I am reading the data from internal memory and
duplicating it in some Tx buffer in the internal memory of processor.
Then in order to actually send the data I am using the Tx Buffer for
writing the data to the USB buffer. I commented the duplication code
and jus wrote some junk data directly from the Tx buffer. This also
made no difference in speed.
The configuration of my host PC are:
2.4GHz, 256MBytes RAM and Windows XP.
On opening the Device Manager of my computer I clicked on UNIVERSAL
SERIAL BUS CONTROLLERS. There 4 USB Host Controllers were listed to
which the USB Root Hubs are attached. On checking the properties(by
doing a right click on each listed USB Host Controller and selecting
properties) of each USB Host Controller, I found in Advanced tab option
that the Bandwidth for each USB Host controller is only 10% which is
reserved for that particular host controller. So, I doubt that does
this thing will limit the speed that I can acheive. That is if a
particular host controller has been assigned only 10% of the system
bandwidth then will it affect the maximum USB speed that I can achieve.
If yes, then how can I achieve the practically possible speed with my
ISP1582.
My other doubts are as follows :-
1) When I reduced the wait states then why there was no effect on
the speed.
2) Also, when I wrote the functions from C to assembly then it is
expected that there should be some increase in the speed, then also
there was no effect, why?

Please Help !
I would be obliged for your valuable suggestions.

With Best Regards
Himanshu Jain
--------------------------------------------------------------------------------

Posted by Noway2 on May 15th, 2006



Himz wrote:
Often times the theoretical maximum data rate of a USB link is just
that, a theoretical maximum rather than the rate at which the user
should expect data to transfer.

In order to achieve the maximum data rate, you will need to fill every
frame and microframe with a full packet of data. To do this, the
transmitter must have enough data to send, queue up the data, place it
in data structures, and transfer this to the USB controller fast
enough, which is a formidable task. Having said that, you will need to
examine the traffic with a USB analyzer, looking at the content of the
frames and microframes and where the 'holes' are to be able to figure
out what is causing them.

Quite frankly, though, if you are getting the information through fast
enough for you application, I wouldn't worry about achieving the
maximum data rate.


Posted by Himz on May 17th, 2006


Thanks for your reply.
I don't have a USB bus analyzer. Is there some software which can serve
my purpose.

Himz

Posted by CBFalconer on May 17th, 2006


Himz wrote:
What purpose?

In general on usenet you should realize that readers may very well
not have convenient access to previous articles in a thread. That
means that your reply articles should include adequate context, so
that they stand by themselves. Google is NOT usenet, it is only a
very poor interface to the real usenet system. To include proper
context when using google, see my sig. below. Please be sure to
read the referenced URLs.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>



Posted by Himz on May 18th, 2006


I am sorry for the inconvenience caused to you. The original message
which I posted on the group is as follows.
---------------------------------------------------------------------------------------------------------------------------

Hello All,

I have been successful in implementing the USB2.0 communication
protocol for ISP1582 USB Peripheral Controller. With my current code I
am able to achieve the data rate of only 24Mbits/sec, which is too less
comparable to the actual data rate that can be practically achieved. I
request for your support and valuable suggestions in achieving the
maximum possible data rate. Before listing my doubts let me jot down
the ISP1582 configuration I am working with and all that I have tried
on my side to achieve a better rate.
ISP1582 USB Peripheral Controller Configuration is as follows:
Number of Enabled Pipes :- 02, ENDPOINT1IN and ENDPOINT1OUT
Type of Data Transfer Selected :- BULK
Type of Interrupt :- Active Low / Edge
Triggered(Level Triggering also tried, but no effect)
Buffer Type :- Double Buffering(Single
Buffering also tried, but no effect)
Setting of Various Registers :- MODE REGISTER
-> 0x0D
INTERRUPT
CONFIGURATION REGISTER -> 0x68
INTERRUPT ENABLE
REGISTER -> 0x0000D3B9
DMA CONFIGURATION
REGISTER -> 0x00
DMA HARDWARE
CONFIGURATION REG -> 0x00
Currently I am not using DMA.
Setting of Enabled EndPoints :- ENDPOINT1IN -> Maximum
Packet Size is 512Bytes, Transfer type is Bulk and Double Buffering
disabled
ENDPOINT1OUT ->
Same as ENDPOINT1IN
I have also tried with single buffering.
With all these settings I am achieving the data rate of 24Mbits/sec.
Now, in order to increse this value I did the following exercises:-
1) Earlier the processor which I have interfaced to ISP1582 USB
Peripheral Controller had 3 wait states. That is the read/write cycle
for the external read or write is extended by 10nsec for one wait state
inserted. I reduced the wait states from 3 to a single wait state which
is the minum possible that I can afford for getting the chip
enumerated. Reducing further fails the enumeration process.
2) Next, I have written the complete code in C language. I converted
the two main functions that are being called many a times(i.e. the read
and write from the ISP1582 USB Peripheral Controller Buffer) from C to
Assembly. This also didn't help.
3) While sending the data from internal memory of processor to the
host PC via USB, I am reading the data from internal memory and
duplicating it in some Tx buffer in the internal memory of processor.
Then in order to actually send the data I am using the Tx Buffer for
writing the data to the USB buffer. I commented the duplication code
and jus wrote some junk data directly from the Tx buffer. This also
made no difference in speed.
The configuration of my host PC are:
2.4GHz, 256MBytes RAM and Windows XP.
On opening the Device Manager of my computer I clicked on UNIVERSAL
SERIAL BUS CONTROLLERS. There 4 USB Host Controllers were listed to
which the USB Root Hubs are attached. On checking the properties(by
doing a right click on each listed USB Host Controller and selecting
properties) of each USB Host Controller, I found in Advanced tab option
that the Bandwidth for each USB Host controller is only 10% which is
reserved for that particular host controller. So, I doubt that does
this thing will limit the speed that I can acheive. That is if a
particular host controller has been assigned only 10% of the system
bandwidth then will it affect the maximum USB speed that I can achieve.
If yes, then how can I achieve the practically possible speed with my
ISP1582.
My other doubts are as follows :-
1) When I reduced the wait states then why there was no effect on
the speed.
2) Also, when I wrote the functions from C to assembly then it is
expected that there should be some increase in the speed, then also
there was no effect, why?

Please Help !
I would be obliged for your valuable suggestions.

With Best Regards
Himanshu Jain
------------------------------------------------------------------------------------------------------------------------------

The reply to me for this message is as follows:

------------------------------------------------------------------------------------------------------------------------------

Often times the theoretical maximum data rate of a USB link is just
that, a theoretical maximum rather than the rate at which the user
should expect data to transfer.

In order to achieve the maximum data rate, you will need to fill every
frame and microframe with a full packet of data. To do this, the
transmitter must have enough data to send, queue up the data, place it
in data structures, and transfer this to the USB controller fast
enough, which is a formidable task. Having said that, you will need to
examine the traffic with a USB analyzer, looking at the content of the
frames and microframes and where the 'holes' are to be able to figure
out what is causing them.

Quite frankly, though, if you are getting the information through fast
enough for you application, I wouldn't worry about achieving the
maximum data rate.
-----------------------------------------------------------------------------------------------------

Thanks for your help!

Himanshu
---------------------------------------------------------------------------------------------------------------------
CBFalconer wrote:

Posted by CBFalconer on May 18th, 2006


Himz wrote:

The point of my earlier message was to enable you to follow proper
usenet protocols, which make communication much easier. Now that
you have found out how to quote with google, you need to also learn
what not to quote. You only need to quote the portions that are
relevant to your reply, which in turn should be placed after (or
intermixed with) the quoted material.

Here are some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

Congratulations on achieving the first steps.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>



Posted by Noway2 on May 18th, 2006


Himz wrote:

<snip>

If you are able to attempt communication with a PC, try USB Snoopy. In
my USB project, I wasn't able to use it to analyze the communications
in my application as I was developing a host controller not a
peripheral device. However, I was able to see what Windoze (spelling
intentional) and Linux did and extrapolate what I learned to my
application.

You may also find some valuable information on www.lvr.com, which has a
section on embedded USB. Also look at usb.org in the developers
forums. You should at least find some information discussing maximum
achievable data rates and information on USB protocol analyzers.



Similar Posts