Skip to content
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

ESP32S3 - I2C issues #2607

Open
MaBecker opened this issue Feb 2, 2025 · 11 comments
Open

ESP32S3 - I2C issues #2607

MaBecker opened this issue Feb 2, 2025 · 11 comments
Labels
ESP32 This is only a problem on ESP32-based devices

Comments

@MaBecker
Copy link
Contributor

MaBecker commented Feb 2, 2025

Sample code to read version from a CST816S i2c module from a ESP32-S3-Touch-LCD-1.28 device

// CST816S
const ID = 0x15, REG_VERSION = 0x15, REG_VERSION_INFO = 0xA7;

I2C1.setup({sda:D6,scl:D7});

print('Version:', I2C1.readReg(ID, REG_VERSION, 1));
print('Version Info:', I2C1.readReg(ID, REG_VERSION_INFO, 3));
/*
Uncaught Error: jshI2CWrite: slave doesn't ACK the transfer
 at line 39 col 50
print('Version:', I2C1.readReg(ID, REG_VERSION, 1));
                                                 ^
Uncaught Error: jshI2CWrite: slave doesn't ACK the transfer
 at line 40 col 60
...Reg(ID, REG_VERSION_INFO, 3));
                              ^
*/
@MaBecker MaBecker added the ESP32 This is only a problem on ESP32-based devices label Feb 2, 2025
@MaBecker
Copy link
Contributor Author

MaBecker commented Feb 2, 2025

@SimonGAndrews Which module i2c module did you tested with an ESP32-S3?

@SimonGAndrews
Copy link
Contributor

I was Using a ESP32-S3-WROOM-1-N8R8 on an
Olimex ESP32-S3-DevKit-Lipo Development Board.
Here

@MaBecker
Copy link
Contributor Author

MaBecker commented Feb 2, 2025

@SimonGAndrews Which i2c device did you use for testing?

@gfwilliams
Copy link
Member

You could check out what mentioned @SimonGAndrews in #2589 - looks like it was an SSD1306 display.

@MaBecker it's an on-board I2C thing you're using is it? Can you access it using software I2C? Just to rule other issues out?

I wonder whether maybe there aren't pullup resistors but it expects the chip to put its' internal ones on?

@MaBecker maybe you could try some other hardware on the S3 and see if that works?

@SimonGAndrews
Copy link
Contributor

@MaBecker Good morning, Yes I agree something still not correct with the S3 I2C.
Im testing with a PCA9685 on ESP32 and C3 . Imusing one of the off the shelf servo/led x 16 driver boards with leds soldered on the outputs. However, on the S3 i did not get as far as using actually with this device, I stopped after setup gave me the correct debug response at setup (ok sorry lesson learnt) and on checking this am there does seem to be some issues (not exacly like yours, but time outs on writting to the device) . So it doesnt look right on first attempt. i will setup a logic analyser on it and check the S3 technical Spec for any differences in the I2C section.

PS might be worth building with DEBUG=1 as the code I changed put out a few debug messages onsetup etc.

@SimonGAndrews
Copy link
Contributor

Image
S3 test setup

@SimonGAndrews
Copy link
Contributor

Image

@SimonGAndrews
Copy link
Contributor

OK , @MaBecker I think my initial issue, was with the pin I was trying , on my board, for sda (D6 as in your case) was tied to ground for a battery status facility. This error was a timeout error.

On changing the pin to D15 I got the above result , Ive not checked the data but the readReg() function does appear to work.

I did get your error when I used the wrong address of the I2C.

@SimonGAndrews
Copy link
Contributor

SimonGAndrews commented Feb 3, 2025

Image

This trace is from the code above.
It shows the clock 100hz and an ACK on the address read.

If I use the wrong I2C address I dont get the ACK (we get a NAK).
So maybe the issue is wrong address or one of @gordons suggestions above like the PullUps

@SimonGAndrews
Copy link
Contributor

I am about to try the S3 in a small project over the next few weeks (A greenhouse monitor) , So will push it a bit harder soon.
Got some bits comming tomorrow for the project, Including one of these Seeed XIAO ESP32S3 whcih coincidentally looks like the processor on your board. :)

@SimonGAndrews
Copy link
Contributor

I came across these thia am while looking at this, In case you dont have them.
QMI8658C_datasheet_rev_0.8.pdf and
circuit diagram for the touch

I note from the spec the QM... device is used for SPI and I2C , and the spec seems to show external pullup resistors in the I2C configuration. On a quick look I dont see these in the circuit diagram. ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ESP32 This is only a problem on ESP32-based devices
Projects
None yet
Development

No branches or pull requests

3 participants