0

I want to connect an RTC to a master Arduino, send the time data to a slave Arduino through I2C, then connect an LCD to the slave and print it out.

can it be done? A think it would mean that the slave Arduino is a master for the LCD a the same time and it would mess up my code. Any input would be highly appreciated.

  • the LCD is I2C? what model? – Juraj Apr 4 '18 at 10:23
  • I believe it's SPI. The model is LCD1602. – Máté Molnár Apr 4 '18 at 10:47
  • 1
    LCD1602 is just a description of the size - a 16x2 character LCD. What specific LCD is it you have? – Majenko Apr 4 '18 at 13:19
  • And does it have the I2C backpack? – SDsolar Apr 5 '18 at 2:15
  • I2C allows for multiple masters. So you could connect the RTC to both Arduinos at the same time. Though you might have to do a bit of extra work to prevent the Arduinos from accessing the RTC at the same time. Either prevent those collisions, or gracefully handle them when they occur (which depending on how often you access the RTC, might be very rare). – Gerben Apr 5 '18 at 9:06
1

The LCD is connected over SPI. The MCU can be an I2C slave and the SPI master. There is no conflict.

0

From what I understood. I think you are trying to pass time to 2 ardruinos using one RTC. m.a. = master arduino s.a. = slave arduino

                            RTC
                            /\ (i2c)
                        m.a.  s.a.-------------(LCD)
                         L______|(spi)

No you cannot but you can read time in master and then relay it to slave using your own protocol (i.e. "Apr 4 21:20:16 IST 2018") and let it print to LCD.

      RTC ------ m.a. ======= s.a. ++++ (lcd)
            i2c          spi        
        (read reg.)  (pass string)

Humble NOTE:- If possible draw some digram while you are explaining circuit. It will be far easy to understand and answer than explaining circuit. may be draw on paper and upload to igmur/drive and add link in question or upload it here. My ascii digrams may not be best but I think they pass message clearly.

  • The actual wording of the question is clear and without conflict: " connect an RTC to a master Arduino, send the time data to a slave Arduino through I2C, then connect an LCD to the slave and print it out." – Chris Stratton Apr 4 '18 at 17:00
  • there was ambiguity as in subject it was mentioned about connecting to two arduinos. – Devidas Apr 4 '18 at 17:56
  • The word in the subject says "for" not "connecting to" – Chris Stratton Apr 4 '18 at 18:08
  • my mistake I misinterpreted it. But I still felt it was not very clear so mentioned it. This was my view. – Devidas Apr 4 '18 at 18:24

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.