Lost values, again.

I have addressed this issue earlier, but the conclusions made did not help at all. I know someone has the correct answer to this, otherwise there would be no way to properly send values between two arduinos through serial tx/rx. The issue is simply that when I send values through Serial from a lilypad, the 3 digit values that I send get cut off to 2 digit values on the other side (an arduino 2009), or simply dont go through at all.

This was done with rx - tx and tx -rx as well as gnd to gnd and 5v to 5v…

Can someone explain what needs to be done for the values to be properly sent and received? I have no delay betwen when values are sent, nor do I have delay after serial.available and serial.read run.

////// EDIT… sorry… new discovery… apparently the values are basically random… so the question changes a little… can anyone help explain why I receive random numerical values on my 2009 in this case?

Sorry for the double post, but could this “issue” be due to the fact that lilypads run at 8MHZ while the 2009 at 16MHZ?

Perhaps because the internal oscillator of the Lilypad is not accurate enough? Try a slower baud rate, it could perhaps fix it!

also, I don’t think it’s related but don’t connect their 5V rails (unless one is powering the other).

could you describe exactly your wiring and computer hookup? How do you know what you’re sending and receiving? Could the PC connection be interfering with the arduino-arduino link?

To simplify things, try sending steady spaces or 'A’s or whatever to see what you get.

Good point. I don’t have my arduinos on my ATM, but if I remember correctly, I did indeed hook up the +5v’s, the GNDs, and then I also did rx-tx and tx-rx. I will try to lower the baudrate when I get back to this at home, but the second reply reminded me of an issue as well - i don’t think I saw any code running through the serial monitor at all when the 5v’s where not connected.

i don’t think I saw any code running through the serial monitor at all when the 5v’s where not connected.

I don’t think connecting the supplies would have any big obvious effect, it’s just bad practice…

I do think hooking up rx/tx between two arduinos won’t work if one of them has pc serial running since it would be using the same pins.

Touche (is that how you spell it?). I will try that, but I guess I will need to somehow use hardware to show that the values go through… an led with PWM control perhaps, or maybe printing the values to an lcd?

Just another thought - would using software serial be a decent idea? I mean have the 2009 in my setup be connected through say pins 2 and 3 using soft serial to the lilypad, and thus have the usual pins 0 and 1 be open for normal serial contact with the pc… then just read the soft serial rx pin on the 2009 and print it out to the serial monitor - this should stop the “conflicting issue” i’ve been having, right?

yes, software serial should work if you need to use PC serial at the same time as arduino-arduino.

Also, maybe think back to where you started having problems that made you think there was something wrong and whether the PC serial was connected. If so, try disconnecting it in that instance and see if you can get back on track to where you were originally going.

So now I have 3 different possible solutions… hopefully one will work.

Thanks fellas :slight_smile: