I want to connect an SPI device (an SD card module) to my SF Thing. I understand chip select may be any free pin I choose, but I’m not sure about SCK. My Uno and my Wemos D1 mini both have designated pins labeled SCK. Is pin D14 on the “Thing”, labeled SCL/SCLK, the same as SCK? If so, can a “wire” device that uses SDA and SLC such as an RTC also be used without interference between the two?
Thank you
Which “Thing” board? (ESP32 Thing (Plus), ESP8266 Thing (Dev), etc.)
Hello there.
If I understand your question correctly, you have a SPI device and a I2C device you want to connect to the same board. That should work just fine depending on the capabilities of your board. What you’re going to need to do is determine what pins your board are assigned to SPI and I2C.
SPI:
- MOSI.
- MISO.
- CLK. Ssometimes called SCK, SCLK and *maybe* SCL depending on who wrote the documentation for your board.
- (Don't confuse the clock pin for SPI and I2C, they are different pins on most (all?) boards.)*
- CS.
(Can be any digital I/O pin)
I2C:
- SCL.
- SDA.
Most of our Thing boards have a graphical data sheet that tells you which pins are assigned to each function. Look in the ‘Documents’ section on the product page for what pins to use. Also, SPI pins are typically specified in hardware but some boards let you assign SPI or I2C to whatever pins you want. It just depends on the board.
Since both I2C and SPI use a different set of pins, you can have a I2C and SPI device on the same microcontroller at the same time and both will play nicely with each other. Just be aware that the clock pin on SPI and I2C are different pins.