0

I wish to create a system consists of WEMOS mini & Pro-Mini sharing info using Serial ( one MCU is dedicated to react input-output, and second for MQTT commands ) sharing same Power input. From what I read in tutorials, at boot Serial wires have to be disconnected, in order to accomplish boot.

A) is that true that at boot Serial has to be disconnected?

B) is there a way that 2 MCU can be connected at all times, including reboot when needed ( such as power failures ) ?

4
  • A) no B) no problem. why do you ask? – Juraj Feb 25 at 13:43
  • @Juraj since when I tried rebooting 2 MCUs connected in Serial ( Tx-> Rx , Rx->Tx ), failed. It succeeded only when wires removed – Guy . D Feb 25 at 13:45
  • ground was connected? – Juraj Feb 25 at 13:49
  • @Juraj - Yes GND was connected – Guy . D Feb 25 at 14:34
1

A) is that true that at boot Serial has to be disconnected?

No, that is not true. However if you are using Serial to communicate on the Pro Mini you will need to disconnect the ESP8266 in order to program the Pro Mini as it will interfere with serial communication to the PC.

B) is there a way that 2 MCU can be connected at all times, including reboot when needed ( such as power failures ) ?

Given that A) is a no, then B) is irrelevant. It will just boot.

The only caveat is that the ESP8266 will squirt some boot messages out of serial as it boots at 74880 baud, so you have to be able to cope with that noise in whatever protocol you design between the two boards.

1
  • Perhaps your first sentence was what I recalled when disconnecting the wires was needed. Regarding Serial "noise" - you are right... some maneuvers were done to overcome ESP8266 boots – Guy . D Feb 25 at 14:38
1

A) is that true that at boot Serial has to be disconnected?

Not exactly, if you're careful about what is communicating with what and when. That you protect against multiple things driving the same connection, etc. And you don't mind being very confused a lot of the time. And that you're holding one board in reset while the other is being programmed.

B) is there a way that 2 MCU can be connected at all times, including reboot when needed ( such as power failures ) ?

If you don't have a compelling reason to avoid it, you may be better off using I2C between the two of them. Then your serial is left alone on both boards to behave as it normally does. You don't need to sort out conflicts between boards trying to use serial to talk to each other and trying to use their serial transceivers to talk to the host and the conclusion that results from the host and both boards all see traffic from different things. And you have an open collector setup between your two boards which makes independently powering them somewhat less of a problem.

If you do try to use the Pro Mini and ESP8266 USARTs connected together, you should have some series resistance in the connection between the FTDI (or whatever) TX signal and the RX on the Pro Mini. Or between the Pro Mini RX and the WEMOS TX. In other words, anywhere you have two pins driving what would otherwise by the same node in the circuit, you need some current limiting in case they drive in opposite directions, as will happen if you connect their serial connections together. If you look at the Wemos D1 mini schematic or the Arduino UNO, Nano, etc schematics you'll see they've inserted some resistance there for that reason. If you look at the Pro Mini schematic you'll see the FTDI TX line is connected directly to the AVR's RX.

Below you asked why you would need the FTDI connection. If you're not programming the Pro Mini and not using it power the Pro Mini, then you don't.

However, if you're thinking you're going to be able to program the Pro Mini using the serial transceiver on the Wemos and the connection between them, that isn't going to work. The Wemos serial transceiver's TX would be connected to its ESP8266's RX, which would be connected over to the Pro Mini's TX (not RX) because project is operating normally it needs to receive data from the Pro Mini on that pin. Allowing the Wemos serial transceiver to talk to the Pro Mini's RX would require you to wire it in a way that the two boards couldn't use their USARTs to talk to each other. The two usages are only compatible with two different wiring schemes.

4
  • 1
    I'm assuming your Pro-Mini is a 3.3V version. If it's a 5V version you should really shouldn't be connecting its TX directly to the ESP8266. – timemage Feb 25 at 14:44
  • A) I didn't think of using I2C.... How do I share text/JSON in such manner ? B) Why Should FTDI is needed ? Can't I connect Tx/Rx directly ? ( on my test bench a Nano or Pro-Micro is used ) – Guy . D Feb 25 at 14:46
  • 1
    I2C doesn't care what you send over it. The design of the Arduino Wire library is such that it needs to be broken up into small chunks. I will try to address "Why Should FTDI" (to the extent that I understand it) in the answer. Regarding "Can't I connect Tx/Rx directly": in the general case you don't connect 5V and 3.3V signals directly together, particularly not a 5V output to a 3.3V input; sometimes you can do that, not always. It's something you can write an entire chapter on. – timemage Feb 25 at 14:54
  • Will consider using i2c : here's a tutorial instructables.com/I2C-between-Arduinos – Guy . D Feb 26 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.