0

I am using an ESP32 to receive data from web. However in an I2C communication, the EPS32 does not work as a Slave and i already have an Atmega as the Master.

i have seen sites saying Master-Master I2C Connection is possible however, how do i do this? or are there other solutions to have the ESP32 communicate to the ATMega?

asked Feb 7, 2020 at 6:08
1
  • I don't have much experience with I2C, but there are other ways, like UART, or SPI. Commented Feb 7, 2020 at 9:06

1 Answer 1

1

Both your master devices must support Multimaster mode, i.e. Arbitration and Synchronization. See I2C Spec here for a description of the arbitration process.
It's up to you to handle a lost arbitration in your software.

or are there other solutions to have the ESP32 communicate to the ATMega?

Of course. As you considered I2C to be sufficient, UART and SPI are feasible alternatives supported by almost all microcontrollers.

answered Feb 7, 2020 at 10:04
2
  • what do you recommend i do here? use multiple communication styles? I2C and SPI?since all i need is to have 2 master device communicate, while only the other master communicate with the slaves. Commented Feb 9, 2020 at 13:58
  • @JuliusNoelBanayo Depends on your requirements. If you only have to transmit some bytes every 100ms, I2C may be the most economic solution (Multimaster mode is supported by ESL32 and Atmega). If there's much more data and/or you need it fast, you should consider SPI. Commented Feb 10, 2020 at 15:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.