• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Issue with communication between 2 Arduino

 
Ranch Hand
Posts: 338
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 Arduinos connected through their respective TX/RX 1.

One of the Arduinos is the sender and the other one is the receiver. I have the receiver print on the monitor (Serial.println) when there is a serial event on RX1. My issue is that there seems to be a lot of data that is sent on Serial1 from the sender at setup. Is there anything I can do about this?

I use serialEvent1() to handle the incoming messages.
 
Bartender
Posts: 2653
18
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a non-interrupt example available for 2 UNOs:

http://robotic-controls.com/learn/arduino/arduino-arduino-serial-communication

You mention Rx1 and Tx1. Are you using Arduino Megas? It should not make a difference.
 
Adrien Lapointe
Ranch Hand
Posts: 338
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I am using 2 megas.

I'll have a look at this link. It tried with basically a polling routine in the loop(), but it was still picking up the initial garbage. Not sure if the garbage is not just an artifact of the begin() function.
 
Adrien Lapointe
Ranch Hand
Posts: 338
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually, there seems to be a pattern where the sender initially sends 32 zeros, so it is not pure garbage.
 
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should not be any data transferred over the serial lines except what your sketches explicitly write.

If you're seeing stuff that's not in the code, you may be picking up some sort of transmission line noise.

You might also check to see if hardware handshaking is configured but not physically wired.
 
Adrien Lapointe
Ranch Hand
Posts: 338
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now that you say it, I think it probably is noise. It is an intermittent problem. I could reliably reproduce it when I was at home. Then yesterday I was on the road and could not reproduce it at all, no garbage on the line then. Then tonight, I get some once in a while.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!