Pages: [1]   Go Down
Author Topic: how fast can you send 1meg to the arduino using serial?  (Read 920 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you should be able to send it in about 87seconds or some thing.

has any one done this? can they confirm it only takes a few mins?


Thanks
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13846
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
void setup()
{
  Serial.begin(115200);
  Serial.println("I am Arduino");
}

void loop()
{
  unsigned long start = millis();
  for ( long i = 0; i< 1024L * 1024L; i++)
  {
    Serial.write(i);
  }
  Serial.print("\n\ndone: ");
  Serial.println(millis() - start);
  while(1);
}

outputs :
... (lots of lines)

done: 89130 so about a minute and a half under optimal conditions.. If your sketch has to sample a sensor, read eeprom whatever it will take more time.

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8589
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Assuming serial, at 115200 bps that's roughly 11,520 bytes a second or 87 seconds so you're right.

Depending on what devices we're talking about you can use SPI or I2C which are faster.

What are you going to do with all this data?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

building a arduino 2 channel mp3 audio board, and will be storing the mp3 data on dataflash not sd card.  so need a way to get the data onto the flash lol, so will just downloading it using the serial interface. 87sec a meg is not bad as my samples will be small and will probably only add up to a few meg.

I read on this forum u can actually speed up that transfer. where or not it works i dont no hehe
Logged

Pages: [1]   Go Up
Jump to: