Pages: [1] 2   Go Down
Author Topic: Connecting 2 Duemilanove over Serial Port?  (Read 1502 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I need to hook-up two Duemilanove 's so they "talk" with one another (i.e. a button is pressed on one, and an LED lights up on the other). I've tried reading into the master reader/master writer areas, but none seem to work. I'm assuming my code is fine for the moment but that my wiring is the problem. What would be the best way to hook up these boards?
Thanks smiley
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've tried reading into the master reader/master writer areas
Not sure what that means. You will have to post the code and a schematic of how you are trying to wire them up.

However from the title of the post I guess you are trying to use the serial lines. I think you would be better off using the I2C lines. Make one arduino the master and the other the slave. Example code is already loaded into your computer under the file -> Examples -> Wire  menu.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pretty much, I've been using this http://www.arduino.cc/en/Tutorial/MasterReader

But, I'm mainly unsure of which wires to use to connect up. One tutorial says connect pins 4 and 5... another says connect the RX/TX pins... So I'm completely confused.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 651
Posts: 50845
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Pretty much, I've been using this http://www.arduino.cc/en/Tutorial/MasterReader
Stick with one thing until you get it working/understand it.

Quote
But, I'm mainly unsure of which wires to use to connect up.
There is a schematic on that site that looks almost like a picture. How can you look at that and not know?

There's even code on that page to prove that it works.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, and I used that schematic. However, what I wanted to happen didn't happen. So, I've looked at various tutorials, though I haven't "tried" them out completely. So, I'm basically asking which do I connect?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 651
Posts: 50845
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
However, what I wanted to happen didn't happen.
That's a shame.

Now, if you were to describe which code you ran on each Arduino, what you expected to happen, and what actually did happen, we could offer more constructive responses.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code isn't my concern at the moment. What I want to do is light up an LED on one board by pressing a button attached to a breadboard attached to another Arduino. I just need to know whether to connect the boards through the 4/5 pins, as the tutorial suggests or through the RX/TX pins as other tutorials suggest. Once I know that, I'll come back an revisit the code if it doesn't work. No tutorial is giving me exactly what I want, so I'm unsure if the wire connections matter for exactly what you want to send... Or in the programming.
Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any advice or tutorial links would be extremely helpful smiley-wink
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 72
Posts: 3760
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are mixing up i2c communications with the standard serial port. You could indeed use the serial port(RX,TX) to have two arduinos talk to each other, but you'd lose the ability to use serial for debugging. Your tutorial, on the other hand, is all about i2c, which uses pins 4 & 5.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26621
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh! Analogue pins 4 and 5!
Why didn't you say that?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So pins 4/5 would be best?

They basically do the same thing I'm assuming.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another, possible really dumb question... how do I view the serial window to make sure the program is working? If I just follow the tutorial I previously linked, I should see "hello" pop up or something, right?
I don't see anything, and I want to make sure I'm doing that right so I can experiment further.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
They basically do the same thing I'm assuming.
No that is wrong. You are using I2C not the serial port so don't use TX & RX.

Quote
how do I view the serial window to make sure the program is working?
You connect the master arduino to the PC through the USB lead and open the serial window in the arduino environment.
You run only the code in that tutorial - no additions. You wire up pins 4 together, pins 5 together AND the grounds from each arduino together.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe I did that, but no serial window words were appearing to me.  smiley-confuse

Anyway, I didn't get that tutorial to work, but I managed to get it to work the way I wanted it after tweaking the code (How does that work??? smiley-mad)
But, thanks for everyone's help.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, and for anyone who happened to be having similar issues, or is just curious, I switched from the Master Reader/Slave Writer to the Master Writer/Slave Receiver tutorial... I think it worked better in this situation.
Logged

Pages: [1] 2   Go Up
Jump to: