Go Down

Topic: serial data transfer between arduino uno and arduino micro (Read 1 time) previous topic - next topic

vima

Jan 08, 2013, 10:18 am Last Edit: Jan 08, 2013, 10:27 am by vima Reason: 1
Ok this is what I have done:

It is exaclty the same other people have done but I do not know what I have done wrong:

Arduino UNO: TX--> RX of arduino micro
Arduino UNO: RX ---> TX of arduino micro.
common GND.

Code for arduino uno: (sender)

Code: [Select]

void setup()
{
Serial.begin(9600);
}

void loop()  {

 //--- display the character just sent on console ---
 Serial.println( "Hello world" );
delay(1000);
 
}  


Code for receiver (micro):

Code: [Select]
void setup()
{
Serial.begin(9600);

}

void loop()  {
if (Serial.available() > 0) {
   int temp=Serial.read();
   Serial.println(temp);
} else {
   Serial.println("Not available data");
}
delay(1000);
}


and I do see not available data.

What am I missing?


retrolefty

Quote
Arduino UNO: TX--> RX of arduino micro
Arduino UNO: RX ---> TX of arduino micro.

and I do see not available data.

What am I missing?



What no Arduino Uno ground pin ---> ground pin of arduino micro?

The Rx and Tx signal lines only create electrical signals if there is a common ground circuit between the two boards.

Lefty

vima

#2
Jan 08, 2013, 10:23 am Last Edit: Jan 08, 2013, 10:26 am by vima Reason: 1
Yews sorry i have done this also. I forgot to mention it..

In both of the boards the TX led is blinking.

retrolefty

Then I'm out of ideas. Software looks pretty basic and OK.

Lefty

vima


Then I'm out of ideas. Software looks pretty basic and OK.

Lefty



Try it with two Arduino Uno and it works. Does it mean that my micro is problematic or I missed something about micro that I should do?

PaulS

Quote
Try it with two Arduino Uno and it works. Does it mean that my micro is problematic or I missed something about micro that I should do?

Yes, you have missed something. The Micro is like the Leonardo. The TX and RX pins are not connected to the Serial instance. They are connected to the Serial1 instance, which is separate from the USB-to-serial converter instance that Serial is connected to.


PaulS

Quote
In my code i should replace Serial.read() with Serial1.read()?

On the Micro, yes.

Go Up