The project I posted about before is moving along. Now that the
parallel and ISA drivers are working, the next step is to develop a new
USB interface to replace the old ones.
As a first step, my customer got an ISA to USB interface hardware as
well as another USB 1.1 compatible Full Speed interface. When tested,
these interfaces were glacially slow compared to the ISA or parallel
hardware.
The application’s architecture sends out a single byte at a time and
reads in data one byte per bus transaction. It’s not efficient, but
that’s how the system was originally architected. The external chassis
is little more than an extension of the ISA bus and the interface
hardware just transmits ISA signals to the external chassis.
I did some research and I can’t find it now, but apparently the bus
controllers for Full Speed have a per transaction delay. As I
understand it, UHCI hardware has a delay of 4 ms per bus transaction and
OHCI a 2 ms delay. I was trying to find more information today and all
I can find is some information saying the scheduler runs on a 1 ms
schedule. Nothing about the 4 ms or 2 ms timing. I don’t even know
what the 2 ms or 4 ms timing is called.
Running the initial test hardware and looking at it with a USB analyzer,
the timing is almost exactly 4 ms per transaction. The motherboard of
the test system is an Intel chipset, so it’s obviously a UHCI controller.
I’ve switched gears to the Cypress FX2 High Speed microcontroller,
which, of course, will be running with the EHCI controller. Will the
transaction timing be the same as with the UHCI, or will this improve?
I have several different firmware design options I can do, but the
transaction timing is a key to my decision. If I can get the throughput
timing down to about 1/10 the timing with the USB 1.1 controller, the
delays will be imperceptible to the user and it will be about as fast as
the current system with ISA. (The total data throughput on the system
is fairly low.)
I have figured out how to reduce the total number of transactions on the
bus by combining some data patterns into a single transaction, but
overall, I’m only going to be able to reduce the total number of
transactions by about 1/2 by doing this.
The easiest way is to do all the transactions as vendor functions on
EP0. I only need to create about 6 different functions which are all
similar. If the per transaction speed with High Speed is good enough,
then this is all I have to do.
If the per transaction speed is too slow, I’m going to have to do
something more complex. I thought the best way around this is with an
Isochronous endpoint that has a software FIFO in the Windows driver for
OUT transactions. The driver would spool up transactions as the
software sends them and then sends them out on the Isochronous schedule.
This has its disadvantages though. Isochronous has no protection
against data loss and it makes everything more complex.
The best solution would probably be to move much of application code
that accesses the hardware down to the firmware and just return the
results to the PC. The application does a lot more outs than ins.
Typically it sends a series of out bytes to set something up, then it
might read a status byte, or read a value from an A to D converter.
Doing this would likely break the schedule though. Rewriting all of
these functions would be a major task.
If EP0 method works OK, but is a bit marginal, I can move one
application function to the firmware that should be fairly easy and does
make sense down there. At start up the application code now does a
search for installed hardware in the external chassis. There is a
possible for 256 different hardware addresses out in the chassis and it
tests them all by setting a card address, then testing the status byte
via an in call.
Moving this to the firmware and returning a block of 256 bytes via a
bulk transfer on call from the PC application would probably speed up
initialization dramatically. The FX2 would probably do the entire
hardware scan and have the results between the time that the technician
turned on the external chassis and started the application.
Anyway, what is critical for me to know is the transaction timing (I’m
probably using the wrong term for it) on the EHCI controller. If I’m
out to lunch on any of my other thoughts, please let me know. I’ve
worked with USB before, but due to the vagaries of R&D, the previous
projects ended up getting canceled before I got this far into them and
the last one was 10 years ago.
Bill