Using a UDOO Quad, I am attempting to push data from the Atmel SAM3X8E (Arduino side) to the Freescale i.MX 6 (Linux side) over the serial port as fast as possible. Currently, I am limited to about 10,000 bytes/second, which is plausible because the serial port is configured to 14,400 bytes (115,200 bits) per second. Does anyone know how I can increase the speed of the serial connection? Alternatively, if there is some other means besides Serial to pass data to the ARM processor, I could use that. My Arduino sketch is below. As it is, the "Unable to write quickly enough" is sent. If two characters are removed from Serial.println("012345678901"), then it passes. I am using the built in Arduino Serial port monitor (Tools -> Serial Monitor).
unsigned long sample_period = 1000; //micro seconds.
unsigned long current_time = 0;
void setup() {
Serial.begin(115200); //115200 bits per sec, 14400 bytes per sec
current_time = micros();
}
void loop() {
int wait_count = 0;
while(micros() - current_time < sample_period) {
wait_count++;
}
if(wait_count == 0) {
Serial.println("Unable to write quickly enough");
}
current_time = micros();
Serial.println("012345678901");
}
Edit: After reading Sendhikumar's comment below, I was more systematic and went through all the frequencies in termios.h. I found that 576000 bits per second is valid, and my new data rate is 56,000 bytes per second. I'd still like more speed if possible. The built in Arduino serial monitor does not support this frequency, so now I am catching the serial data with a custom C++ program (based on www.tldp.org/HOWTO/Serial-Programming-HOWTO/x115.html).