I’m doing a similar project as the link below that uses the Seeeduino XIAO, LCD display and the maxim blood oxygen sensor. I’m a little confused with the circuit connection this guy made.
Pin 4 and 5 are the actual and the only SDA and SCL on the XIAO, which are already used by the maxim sensor according to his connection summary. But I can’t understand how he used pin 8 and 10 for the SCL and SDA of the LCD display? I can’t find anything in his code that assigns pin 8 or 10 as an additional SCL/SDA for the XIAO.
I’ve read somewhere that two I2C devices (display and sensor) can be connected to the same SDA and SCL pin in parallel with a pull up resistor, but this seems to work differently.
I’m not sure what I missed but I would love to understand how he made pin 8 and 10 as additional SCL and SDA. Any help would be appreciated, Thank you
Hi there Don Ham & welcome.
OK so I see there are a few errors in the Git comments of the code .ino file
first it appears the display is an Hardware_SPI display and pins used and initialized back that up
#include <Arduino_GFX_Library.h>
Arduino_DataBus *bus = new Arduino_HWSPI(3 /* DC */, -1 /* CS */);
Arduino_ST7789 *gfx = new Arduino_ST7789(bus, 2 /* RST */
it’s not a second bus of the i2c. It’s a display so there is no MISO connection btw.
Interrupt is D0 not D10 as in the comments. Pin D3 is the ChipSelect, pin2 is reset for the display.
Yes it’s a BUSS so more than one device can be on the wires, hence the pull up resistors.
check this LINK covers many of the possible SPI and I2C configurations, about 3/4 away down the page addresses your questions.
Look at it again with all that in mind and it works
HTH
GL PJ
This circuit diagram and the link really helped me understand some of the basics, so thanks a lot!
I’m confused about something else now lol! Since it is a hardware SPI display, I thought there would be a “#include <SPI.h>” in his .ino code file, but I can’t seem to find it. Is it included in the “#include <Arduino_GFX_Library.h>” or is it not needed at all?