Is there a way to send from Arduino Uno to the host pc via usb-cable faster than baudrate 115200? The serial monitor baudrate list ends at 115200 (version 0021),
but when experimenting with own programs up to 921600 bd seems to "almost" succeed.
(win XP, reading COM13 with hyperterminal of XP).
I am producing megabytes or even gigabytes of sensor data in Arduino and would like to send them continuously to pc for analysis. One way would be to use an microSD-card in Arduino and gather data there, but it would be better, if serial transfer to host via usb would succeed .
I did experiment with this program:
long starttime, endtime, elapsedtime;
int lines = 500;
long baudrate = 921600; // 115200;
String s = "0123... 1 2 3 4 ...49";
int linelength = s.length() + 2; // incl carriage return + line feed
void setup(){
Serial.begin(baudrate);
}
void loop(){
starttime = micros();
for (int ind = 0;ind < lines;ind ++){
Serial.println(s);
delay(10); // remove or vary this, or use delayMicroseconds(100)
}
endtime = micros();
elapsedtime = endtime - starttime;
Serial.print("baudrate=");
Serial.println(baudrate, DEC);
Serial.print(lines, DEC);
Serial.print(" lines with ");
Serial.print(linelength, DEC);
Serial.print(" characters each, elapsed time in microseconds = ");
Serial.println(elapsedtime, DEC);
Serial.print("actual throughput chars/sec = ");
float charspersec = lines * linelength / (float(elapsedtime) * 0.000001);
Serial.println(charspersec, 3);
while(true){
}
}
When using delay(10), the data arrives well at baudrate 921600 , but with shorter delays there seems to be something like buffering problems. Or might be the receiving program is too slow (?).
Any ideas to get data to host fast?