Skip to content

I2c doesn't work, when SPI is enabled. #2720

@Flo082002

Description

@Flo082002

Hardware:

Board: Dev Module
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 10

I have a problem with when I use i2c and SPI together.
The i2c comunication only works when I use no SPI.


#include "SPI.h"
#include <Wire.h>


#define SPI_MOSI      23
#define SPI_MISO      19
#define SPI_SCK       18

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin();
  Wire.beginTransmission(0x60);
  Serial.println(String(Wire.endTransmission()) + " Error");
  delay(200);
  SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);

}

void loop() {
  // put your main code here, to run repeatedly:
  Wire.beginTransmission(0x60);
  Serial.println(String(Wire.endTransmission()) + " Error");
  delay(1000);
}

The first i2c transmition works fine.
But after enabeling SPI and the i2c is broken and Serial.println(String(Wire.endTransmission()) + " Error"); returns 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions