I am trying to set up an SD card reader and MAX6675 thermocouple on an UNO R3. I have the two SPI units sharing the same SCLK, MISO with the SD card on CS pin 10 and the MAX 6675 on CS 2.
The Thermocouple seems to work fine but as soon as I initialise the SD card I get zero returned by the thermocouple.
In the code below, the Serial terminal displays
again C= 0.0
It appears that the initialisation of the SD card makes the MAX6675 not be able to read any more. I have looked through the MAX 6675 and SD .h and .cpp files and cant really see why, other than perhaps that the SD.cpp seems to set the SPI speed to SPI_HALF_SPEED, I cannot find a corresponding entry in the MAX6675.cpp. Could this be the root of the problem?
The SD card works fine.
Anyway, my code is attached as a txt file.
Struggling to get to grips with the specifics of daisy chaining SPI devices and relatively new to the Arduino world so I would appreciate any advice you could give.
SPI issue.txt (2.52 KB)