i want to communicate MEGA2560 with DUE through the TWI port but I need to connect a PS/2 to the MEGA2560 and also an SDcard breakout on DUE. How can this happen since PS/2 uses SDA and SDCard both SDA and SCL? Also I use a logical converter between MEGA2560-TWI-DUE.
Why not just use a serial connection between the two boards?
I don't have any serial left!!
I2C (or TWI) uses addresses. The PS2 controller will have an address. Just pick a different address for your other slave.
SD cards use SPI. Different pins; different method. I am not aware of any breakout that uses I2C.
You don’t need a logic converter for I2C. Just make sure that the only pullup resistors in the system are on the 3.3V side. You must desolder RN1 on the Mega board. (Near the SDA/SCL pins, below RX1) This is a “resistor array” that has 8 pins. If you don’t feel like doing that then the Adafruit bidirectional level converter is very good for I2C.
So, PS/2 does not need SDA or SCL? I use any (digital?) pin I want instead?