I am currently working on a project which requires me to take measurements of temperature and record the data only an SD card.
I am using the following components to achieve this.
Arduino Mega 2560
Playingwithfusion max31855k 4ch type k thermal-couple sensor break out board (only two channel is used)
Adafruit Assembled Data Logging shield
The 4ch thermalcouple board comes with their own libarary and some example sketches. I have tested and confirmed that this circuit works on its own. The board uses SPI and PINs 7, 8 for CS.
The data logging shield is designed for a arduino uno. but it can be configured to work with a mega. I have also got the test code for this to work. The adafruit board have an onboard RTC which have been synced to the correct time, this uses the I2c communication.
The problem appeared when I tried to connected both of them to arduino.
The two pins that is being shared by the two SPI devices are SCK and MISO. When calling SD.begin, the error message shows up. this happens with us running the temperature sensor board and only running the code for the SD shield.
It appears that the hardware of the two SPI devices are interfering with each other. But i cant not work out the reason.
I also tested with only one device connected at a time, and running the codes(combined). again, the SD.begin returned error.
after doing some trial and error, it seems when ever i have SPI.begin in the code, SD.begin returns the error message.
I have looked around and found some with similar problems. But in the end could not solve the problem. The temperature sensor board uses their own libarary, this may be the reason behind the conflict?
I'm new to this forum, please feel free if to ask questions or correct any mistakes i've made.