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
--------------------------------------------------------------------------------