Two way serial communication between two boards

Yes it will send and receive simultaneously, not sure why you conclude it won't?

Sounds potentially dangerous to humans, is it?. I'd find a way to shut that situation down in any case independently (and before) any interaction with your Arduino Due data collection.

Also, and what I came here to ask is, how far is the distance between your two Arduinos connected for wired serial communication? I don't think it can be very far, especially if you're using logic level conversion from 5 to 3.3V and vice versa.
Not sure the "official" distance; no doubt one of the others here knows offhand though.

I think this the OP's way of saying there is no need for either end to send and receive simultaneously, rather than "the Arduino is incapable of sending and receiving simultaneously". At least, that's how I read his presentation so far.

Are you just updating us with your progress or do you have a question?

I note you are using 100ms delays, are these just intended as a crude timing thing for testing or are you not aware of they problems they cause and how to avoid using them? I'm guessing one reason is to only send characters every 200ms, are you aware there is a far better way to do that? There's another tutorial for that...

In my test i was trying to send an receive on Serial1
Receiving board was sending part of received message back to first board. Without delays it was not working
Pls point me for this tutorial you mention

OK.
So you discovered that you need to control when stuff is sent, not just send lots of stuff over the serial port as fast as it will go, that's an important lesson. Only send stuff when some condition has been satisfied, which might be a time period or a button being pressed or some other thing that means it's appropriate to send something. For testing purposes a time period is a good place to start.

Look in the IDE:
file > Examples > 02 Digital > Blinkwithoutdelay
Understand what that does and use what you learn to control sending data instead of flashing an LED.
Robin has another tutorial that is also relevant, it is:

The 'several things at a time' in your case are sending and receiving at the same time.

What I hope to see from you is transmit code that sends stuff on some time interval that you have chosen without any use of delay to make the interval, and without the sending part holding up the processor from doing other stuff. For extra points I suggest you make the built in LED flash at a rate that is independent of the timing for sending data and independent of when data is received. For extra extra points put the LED flashing code in a separate function called from loop().

Hmm. While you're at it, think about how you'll get the two back in sync, when the inevitable missed character leaves you dangling(unless you're content with pressing reset on both processors to get things going again). It's another good use of parallel tasks using millis(). That alone should be worthy of a passing grade...
C

Now that you have brought up the fatal problem with the OPs system, some time should be spent determining HOW each of the two Arduino boards will know the status of the other board. That includes time-out when an expected message is not received.

Full circle to post #13. Gotta love it.
To be quite honest, the easiest if this must be, would be for both ends to simply talk as if the other was always present, and not even know if that is true or not. No synch. Think two politicians, "debating"...
But it's up to the OP, if he wants 'awareness', he's in for a world of pain//struggle. KISS, indeed!
C

about 20cm
I have relays that, when switching, already trigger capacitive sensors that change pages on tft :slight_smile: will have to move them further

When serial sending a mix of longer strings via serial1 i tested with piezo cigarette lighter just next to serial wires and it clearly was breaking/changing the string

Ok, I'll try with joy, but will take some time as work + 5children only randomly give me some time.
Thank you, Perry, for this lead

Nope use 2.2k

Why?
The lower the resistors the less they affect the signal, especially the rise and fall edges.

if you dont have enough you can also use 10 ohm,220 ohm 2k 1k.

No you can't because those resistor values are too low and will draw too much current. Even 100R which I suspect you mean is too low.

It is a compromise between current drive and rise time.

i use them to make 5v 3.3v and module is PERFECT. not even a little warming

i read the post and understand as 1 due 1 UNOs :grin:

Warming is not a sign of drawing out too much current from a pin. It only gets warm once the current is so high as to damage the pin.

Prefect it is not.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.