Skip to content

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

Closed
@bhcuong2008

Description

@bhcuong2008

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions