I am working on a project where Arduino is communicating with two devices using SPI. Unfortunately, these two devices has no ss(slave select) pin to communicate with each one separately.
How Can I solve this issue?
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.Sign up to join this community
Ss or cs pin ISS not mandatory for SPI.
A few solutions.
Power on or off the devices. A group pin can do that.
Cut off mclk.
Have a separate sclk pins for individual chips. You will need to share the serial data pins, ored with some diodes or pull up.
I'm sure others will come up with more solutions.
Looking at the MS5540C specifications and assuming there are no other significant parts on the PCB you identified, there does not appear to be a SPI port available.
Neither "SPI" not "I2C" appear in the document. Please check your self to verify.
Instead there is a section on serial communication with the MS5540C part its self. In this section there are a number of diagrams. Here is one:
In the text we find this:
Every communication starts with an instruction sequence at pin DIN. Fig. 6 shows the timing diagrams for the MS5540C.
Which is very nearly if not exactly how I2C works.
The text goes on to say:
he device does not need a ‘Chip select’ signal. Instead there is a START sequence (3-Bit high) before each SETUP sequence and STOP sequence (3-Bit low) after each SETUP sequence. The SETUP sequence consists in 4-Bit that select a reading of pressure, temperature or calibration data. In case of pressure- (D1) or temperature- (D2) reading the module acknowledges the start of a conversion by a low to high transition at pin DOUT during the last bit of the STOP sequence.
Unfortunately, this design appears to prohibit using more than one identical device on the same serial bus.
Workarounds to this design flaw (if it truly exists) include blocking the SCLK or the DIN signal to the un-selected MS5540C.
In many other cases where multiple identical I2C devices are used on the same bus, vendors provide a pin on the device which can be used to alter the address of an individual device.