This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Issue with communication between 2 Arduino  RSS feed

 
Ranch Hand
Posts: 338
10
Chrome Eclipse IDE 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
C++ Linux Netbeans IDE
  • 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
Chrome Eclipse IDE 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
Chrome Eclipse IDE 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: 20766
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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
Chrome Eclipse IDE 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.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!