Go Down

Topic: <solved> Serial connection and weak output (Read 551 times) previous topic - next topic

Rubbernose

Mar 03, 2015, 08:21 am Last Edit: Mar 03, 2015, 06:26 pm by Rubbernose
Hello,
i want to send a lot of triggered (20Hz) values from a MEGA to the PC via RS232. I need 80-90 signs but it works only up to 63 signs. If i double the speed the effect is the same. On the oscilloscope i can see that there is enough time. The needed time for transmitting is 20 %. The idle time is 80%.
At the moment i can transmit 20 x 60 signs = 1200 signs/sec. That is very weak at 57600 Baud.
Without the 20Hz triggering it works perfect...

Code: [Select]
#include <TimerOne.h>
 
void setup()
{
  Serial1.begin(57600); //the same with double speed
  Timer1.initialize(50000); // set a timer of length 50000 microseconds (20Hz)
  Timer1.attachInterrupt( timerIsr ); // attach the service routine here
}
 
void loop()
{
  // Main code loop
  // TODO: Put your regular (non-ISR) logic here
}
 
/// --------------------------
/// Custom ISR Timer Routine
/// --------------------------
void timerIsr()
{
//Serial1.print("#X11111222223333344444444445555556666677777888889999900000111112"); // doesn't work
  Serial1.print("#X1111122222333334444444444555555666667777788888999990000011111");  // that works!!
}

What can i do or what is the name of that "effect"?
------------------------------------------------------------------------------
Solved:
http://forum.arduino.cc/index.php?topic=305093.new#new

Go Up