Hi,
I'm faced with a communication issue between a max6675 & my ESP32 when an ILI 9341 is also connected on the SPI bus.
Both components are appropriately working with separate example code,
with different CS pin.
By the way, when using the Adafruit_ILI9341 tft library with adafruit max6675 library, I suspect that the begin() from the Adafruit_ILI9341 is corrupting the SPI connection by setting the default frequency, as I'm not able to read the value of my sensor anymore.
It seems that the provided adafruit max6675 is pretty minimalist in regards the handling of the SPI communication speed...
Any ideas or recommendations?
Tx,
Samuel
Thanks for your help, I was able to solve my issue.
Just to clarify...
The board is an ESP8266 12-E NodeMCU
The Adafruit_ILI 9341 library is implementing the SPI TFT protocol with its default SPI frequency #elif defined(ESP8266) || defined(ESP32) #define SPI_DEFAULT_FREQ 40000000
Whereas the max6675 is simply reading the data. Thus the ADAFRUIT_MAX6675 library, is implenting its spiread():
byte MAX6675::spiread(void) {
int i;
byte d = 0;
for (i = 7; i >= 0; i--) {
digitalWrite(sclk, LOW);
delayMicroseconds(10);
if (digitalRead(miso)) {
// set the bit to 0 no matter what
d |= (1 << i);
}
digitalWrite(sclk, HIGH);
delayMicroseconds(10);
}
return d;
}
leading to this conflicting situation.
I solved this issue by using D0 & D1 for SCK & SO: