4Mbps Data transfer with arduino!

Hi all,
I need to transfer 4Mbits of data per second between PC and Arduino.
How to do it?
Serial port? Parallel port , Ethernet or USB? which is easier and cheaper??
I have Arduino Duemilanove board!

Thanks in advance!
:slight_smile:

From PC to Arduino. I need data to be streamed at 4Mbps speed! that doen't mean I'll be storing 4Mb of data!!

Arduino is really powerful even with 16MHz. I'm able to get output clock at 8MHz freq !!!

Could you plz help me how to transfer data at '4 Mega bits per second' speed from PC to Arduino?

Thanks!

I need to transfer 4Mbits of data per second between PC and Arduino.

The three protocols available on a Duemillanove and their absolute maximum speeds (@ 16Mhz) are:

  1. Serial (USART) - 2Mb
  2. SPI - 8Mb output (master), 4Mb input (slave)
  3. I2C - less than 1Mb

At a rate of 4Mb you wil have no more than 32 cpu cycles in between bytes for sustained output (or input) and this is a severe limitation. In brief, youโ€™re probably looking at the wrong platform with such a requirement.

The other one that comes to mind is ethernet although I don't know if the ethernet library would max out the bandwidth of the 168/368 at this rate.

You may have to use the parallel mode rather than the SPI of the wiznet module to effectively handle this throughput.

At a rate of 4Mb you wil have no more than 32 cpu cycles in between bytes

Are you sure? If the arduino is running at 16MHz and you get 1 cpu cycle per clock cycle then there is only 4 cpu cycles you can have between bytes.

So set a pin high, set a pin low, store a byte to a port get a byte from somewhere oh just run out of time.

Put simply NO you can't transfer data at this speed out of arduino.

Megabits, Mike. Eight to the byte. You're going to be reading/writing 1kbyte every 2 ms. At that kind of rate, you could perhaps do it if you hard-coded the buffer indices.

Eight to the byte.

And how are you going to do that on an arduino? There is no group of 8 bits I/O you can use to output the data. And where is the data coming from? You can't read it in a byte at a time for exactly the same reason.

i think arduino will be unable to process such amount of data

The USART in SPI mode is eight bits wide.

And how are you going to do that on an arduino?

You could use SPI where bit-shifting is handled by hardware. That way you would get 4 cycles * 8 in between bytes at 4Mbit.

With some clever low level programming, you could probably read from SPI and set 8 digital outputs (using direct port io) at a rate of 4Mb sustained. That is however all you have time for (even millis interrupts would have to be disabled since a single interrupt would take longer to service than 32 cycles and cause loss of data.)

All in all such speeds (4Mb sustained) would not be practical for anything except a very narrow scope of applications. Adding high-speed hardware (such as 10Mbit Ethernet or native USB) does not help much either. You will still need to read/write data from/to the "fast" peripheral using one of the core interfaces.

If we are agreed that we can just about get data in and out at this rate what is the point of the arduino? Why not replace it with a wire?

32 cyc inbetween data is enough to toggle 6 output pin atleast 12 times using direct port I/O! Plz suggest me the most efficient way of transferring the data!

Plz suggest me the most efficient way of transferring the data!

We can only do that when you say where it is coming from and where it is going. Also when you know it has arrived and how you signal it has gone (strobe signals).

The Arduino can do 2mbit in Serial.

Try that first.

Serial I tried with Hyperterminal but as u said it can transfer 2 Mbps max! And I need 4. How about the USB?

@ mike ; plz read earlier post and if you don't know the answer at- least don't post negative replies! The question is how to do it? Rather then could it be done?

The question is how to do it? Rather then could it be done?

That makes no sense. If it indeed can't be done then how to do it is a null question?

As retrolefty points out - it can not be done with a Duemillanove as is and you should already have a pretty good understanding of why and what the constraints are from the answers you're given.

The only interface that could handle inbound data at 4Mb is SPI and this is not a standard interface for PC's. As such additional hardware would be required.

If you want to make an SPI to USB interface yourself, the MAX3420E IC from maxim could to the trick. Then you get full-speed USB (12Mbit) on the PC side and high-speed (20Mbit SPI) on the Arduino side. The Maxim part is available in LQFP and TQFN packages only.

I'm not sure if you're up to building such an interface, and at that you will also need to write the PC side and Arduino side software which even for an expert would be a challenge. If you get all of this right, you have a 4Mbit bidirectional path between PC and Arduino, however with all the constraints as stated in previous posts.

The Arduino would likely only be suitable if it were used as a peripheral control for something like a chip that Freescale makes; IE http://www.freescale.com/webapp/sps/site/homepage.jsp?code=DSP_HOME&tid=vandsp

Like a STOP/START capture function... letting the DSP chip do the heavy lifting.

Again... I refer back to my BRAIN versus MUSCLES analogy.

The ARDUINO performs a brain function... it can tell other stuff what to do... but when you need heavy lifting done... you need to let something else do that... in your case... you need a Digital Signal Processor to cope with that massive data stream. Of course.. you still haven't told us where this stream comes from or what you want to do with it... so any recommendations you get are going remain just as vague.