GPIO out of PC - Clarification, USB 2 SPI

Thank you all for your thoughts on this. I want to clarify my question, since the issue has become more focused, as I see it.

What I'm looking for s a high speed USB to SPI interface. Thw question becomes: "How much latency is there in USB 3.0? " Some posters have said USB has a great deal of latency, which is disturbing.

But if that's not a problem, the high speed boards from

formatting link
- the DLN-4M as I recall, does USB 2 SPI at 480 mHz they say.

The reason I am interested in this capability is the following: The PC platform enjoys high speed engineering design due to a huge market for gamers and general PC speed requirements. Software-wise, the OSes running on the PC have garnered the most attention, so compilers, etc. are most advanced there. In sum:

-SSD storage over SATA 3; 6 gB/s. SSD is 10,000x faster than HD.

-4 gHz cpu + up to 32 gB DDR3 RAM

-USB 3.0 fast transfer.

-software platforms mentioned.

So it makes sense to have the "center-of-gravity" near the PC platform. Then the focus moves to how to interface HW to the PC for fast transfer. The USB 3 interface seems the main serial channel to do this, so naturally I ended looking at USB 2 SPI interfaces like the

formatting link
boards.

Any thoughts appreciated.

JB

Reply to
haiticare2011
Loading thread data ...

More than Ethernet, SCSI, PCIe, of course. It's also possibly backed up behind a slow USB mouse when you need it. To get the CPU to attend to an input, you'd want to use an interface that (under Windows, your BIOS or EFI) generates an interrupt. USB and USB 2 are maser/slave standards, until the master polls, there's NOTHING happening. Until the CPU(s) of the host machine are involved, the USB/SPI interface is just going to buffer data, not process it.

I hope you mean MHz (megahertz) and not mHz (millihertz).

Not completely true; transfer to/from buffers is about the same, READ FROM SSD is fast, WRITE TO SSD has to wait for limited write speed, if/when the buffers fill up. There are solid state disks (RAMdisks) that ARE very fast in a sustained fashion, but SSD usually means flash memory (slower than RAM, especially on write operations).

Reply to
whit3rd

yes, With a PC you you can basically choose between speed and latency

On an old fashion ISA bus parallel port you could probably toggle at pin 1MHz, until the OS decide to go do something else for a while

USB used to be 1ms poll interval, I believe it is now 125us but to get any through-put you need to send large buffers at each interval

An then it'll all be hidden under layers of drivers, buffers and an the OS switching between tasks

-Lasse

Reply to
Lasse Langwadt Christensen

You haven't actually clarified very much - we still don't know any of the important data, such as the latencies you /need/, the bandwidth you /need/, what sort of jitter you can cope with, whether you want lots of small transactions or a few big ones, etc. We can only guess at a simple solution (the FTDI module) - but it could be that you are better served with a microcontroller or even an FPGA connected by USB or Ethernet to the PC, and it could be that you are better served with an embedded PC (either x86 or ARM) with direct GPIO support.

USB 1.1 has a poll rate of 1 ms. Interrupt packets can come faster, and of course the host can send when it wants and thus host to device transfers have lower latency. But for bulk transfers from the device to the host, you have a latency of up to 1 ms at minimum. For USB 2.0, the corresponding rate is 125 us. So these give extra latencies when reading data in.

With SPI, however, it is always the master that initiates the transfer - latency will therefore be much less of an issue.

However, if you put your device on a bus that is shared (via hubs) with other devices that take the bus, you will get latencies. This is worse if you put a USB 1.1 device on the same hub - it can take most of a 1 ms slot during a transfer, thus introducing a 1 ms delay to anything targeting other devices on the same hub.

The device supports 480 MHz USB 2 - that does not correspond to 480 MHz SPI (which would be virtually impossible electrically). It claims 48 MHz on the SPI.

But you have to be careful about throughput, latency, and reaction times. You can get 48 MHz SPI for a long read or write from a fast SPI flash - but not for a device that needs multiple small telegrams.

Forget USB 3.0 for anything other than mass transfer devices (fast USB memory sticks, external hard disks).

SSD's are not remotely close to 10,000 times faster than HD's - they can be significantly faster for some uses, but there are not many tasks where you will see more than a 2 or 3 times speed up overall. There are lots of advantages of SSD's over HD's, but don't exaggerate their speed.

The most commonly used compiler in the PC world is gcc. The most commonly used compiler in the embedded world is gcc. Tools for popular embedded systems are pretty good.

The most cost-effective platforms for computing power at low speed are usually an embedded ARM Linux boards. You can get a small, efficient and low cost board with the computing power of PC's a few years ago.

Forget USB 3.

Forget the Diolan boards - if you want general I/O or SPI via USB, go for something based on FTDI chips. It will be at least as fast as anything with a microcontroller (such as the Diolan boards), and avoid almost all concerns about drivers and libraries. It is a different matter if you want a microcontroller with "local intelligence" and your own program, of course - but even then, FTDI USB-to-UART chips can make things easier than a microcontroller's built-in USB (though the built-in USB can often be faster).

Reply to
David Brown

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.