Skip to content

ESP32-C6 Actual I2C frequency not change, always 100KHz #11241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
bhcuong2008 opened this issue Apr 12, 2025 · 4 comments
Open
1 task done

ESP32-C6 Actual I2C frequency not change, always 100KHz #11241

bhcuong2008 opened this issue Apr 12, 2025 · 4 comments
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Needs investigation We need to do some research before taking next steps on this issue

Comments

@bhcuong2008
Copy link

Board

ESP32-C6-DevKitC-1

Device Description

ESP32-C6-DevKitC-1

Hardware Configuration

GPIO 23 for SDA, 22 for SCL.

Version

latest stable Release (if not listed below)

IDE Name

Arduino IDE

Operating System

Ubuntu 22

Flash frequency

80Mhz

PSRAM enabled

no

Upload speed

512000

Description

Using Wire Scan example. I set frequency 10Khz but actual waveform is still 100Khz. Change to 400Khz, it still keeps 100Khz. Using Wire.getClock() shows the same freq as setting.

Sketch

#include "Wire.h"

void setup() {
  Serial.begin(115200);
  Wire.begin(23, 22, 10000);
}

void loop() {
  byte error, address;
  int nDevices = 0;

  delay(5000);
  Serial.printf("Wire freq: %u\n", Wire.getClock());
  Serial.println("Scanning for I2C devices ...");
  for (address = 0x01; address < 0x7f; address++) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.printf("I2C device found at address 0x%02X\n", address);
      nDevices++;
    } else if (error != 2) {
      Serial.printf("Error %d at address 0x%02X\n", error, address);
    }
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found");
  }
}

Debug Message

Not show any errors/warnings.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@bhcuong2008 bhcuong2008 added the Status: Awaiting triage Issue is waiting for triage label Apr 12, 2025
@bhcuong2008
Copy link
Author

I also test the code on ESP32 S3, and it is the same issue. It's always 100KHz.

@bhcuong2008
Copy link
Author

But with Wire Master example, its frequency could be changed. It's strange.

@lbernstone
Copy link
Contributor

Please verify which version of arduino-esp32 you are using, as this driver is currently going through changes.

@bhcuong2008
Copy link
Author

I use esp-arduino 3.2.

@Jason2866 Jason2866 added Area: Peripherals API Relates to peripheral's APIs. Status: Needs investigation We need to do some research before taking next steps on this issue and removed Status: Awaiting triage Issue is waiting for triage labels Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Needs investigation We need to do some research before taking next steps on this issue
Projects
None yet
Development

No branches or pull requests

3 participants