Win a copy of Functional Design and Architecture this week in the Functional programming 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Issue with communication between 2 Arduino

 
Ranch Hand
Posts: 343
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 343
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 343
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 24283
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 343
10
Eclipse IDE Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic