Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By iwkse
#86884 Hi all,
I'm having an issue with letting an ESP-12E use together a PN532 (SPI) and a DS3231 (I2C)
I've tried to share pins SDA and SCL but it's not going to work together at the same time but only with separate sketches.

So I want to achieve that by giving separate pins for SPI and I2C and I did like that:

I2C connected like:
- SCL - D1 - GPIO5
- SDA - D2 - GPIO4

SPI connected like: (got pins from here https://cdn.instructables.com/FID/TRK6/ ... .LARGE.jpg)
- SCK - GPIO 6
- MOSI - GPIO 8
- MISO - GPIO 7
- SS - GPIO 11

When I load an example sketch just for the PN532, when calling nfc.begin() it crashes and there's a soft reset.
If I use instead pins like:

SCK GPIO 5 (D1)
MOSI GPIO 4 (D2)
SS GPIO 16 (D0)
MISO GPIO 0 (D3)

the RFID is recognized and works.
Any hint on how to let SPI and I2C working together? I would just like to move SCL and SDA from I2C to some other pins so they are not shared.

any help?

thanks!!!

[EDIT]
After some debug in Adafruit SPIDevice, it shows SPI is implemented in software and it resets when CS or/and CLK as set as OUTPUT pins.

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld