I have a SPI controlled LCD attached to the SDA and SCL pins of Arduino Micro as per schematic below. When I attach the I2C Real time clock using the same pins, I cannot get it to work. I am already using the SPI pins MOSI MISI SCK & SS for a SD card reader (DFR0229). In isolation, both the RTC and LCD work fine. I'm usure if this is even possible, please could someone explain my options?
That is correct. I am using the SPI.h library with the SPI controlled LCD with the SDA and SCL pins as per schematic. This works fine as long as I do not attach the RTC to the same pins.
An SPI device, without a chip select is not capable of sharing the SPI bus. You would likely need to connect the E pin on the display to a digital output of the Arduino, and configure it as the CS signal for the display. But, it looks like you have the same problem with the RTC, which does not appear to even HAVE a CS pin, so you have a real problem there. It is probably not possible to use those two devices on the same SPI bus. But you could perhaps use software SPI to connect the RTC to two different pins on the Arduino, if your application can tolerate the CPU overhead that would require.
If I replace the LCD for an I2C device, I should be able to use it with the RTC module on the same SDA & SCL pins? My next issue is that when I use the I2C scanning programme within the Arduino IDE, it did not report back the address of the RTC module (with LCD detached!). Without the address I won't be able to add another IC2 LCD device and control them individually.
Yes, I got that from an internet search. As it worked without an issue for other projects I left it. In the other projects, no other modules were attached to pins SDA and SCL.
You are trying to use the SDA and SCL two different ways. I2C is a bidirectional protocol with device addressing and SPI isn't (addressing is done via the CS lines). When you tell both of them to use the same pins they will fight it out. One (or maybe neither) will win and at least one device won't work.
If you use the common LCD with I2C pack pack it will coexist with the DS3231. They will have separate I2C addresses and will show up when you do the scan.