D-314 / IP2368-Arduino-Library

An Arduino library for interfacing with the IP236x IC. Provides functionalities for reading and managing charging states, battery percentage, and more.
MIT License
19 stars 1 forks source link

Info: some boards have no active I2C #3

Open daskalovst opened 6 months ago

daskalovst commented 6 months ago

i was not able to connect to the IC testing with 5 different boards. tested with arduino uno and ESP32 this code freez on the first request on I2C, even the I2C scanner code freez try to scan the bus.

i assume there was batch of IC with defective, or not active I2C interface

D-314 commented 5 months ago

Make sure that you turn off the LEDs by removing the resistors. Also check that the SCL/SDA connection is correct. Problems on the bus can occur if some device sends incorrect signals. If there is no signal, the data will simply not be received and the MCU should continue to work.

daskalovst commented 5 months ago

be advised, its not connection error. I assume its defective bach of IC

D-314 commented 5 months ago

I have faced with a similar problem. Can you check if the IC appears on the bus while charging?

thetiana commented 5 months ago

I2C scanner not scanning at all when the IP2368 is connected, the ESP32 freeze when send scan command to I2C bus, most probably something with the IP2368, or SCL frequency inconsistency

D-314 commented 3 months ago

Note: The documentation states that the IC supports frequency up to 250kHz. The default frequency for Arduino is 400kHz. Therefore, I recommend setting the frequency to 100 kHz using Wire.setClock(100000);

illysky commented 3 months ago

Hey, I’m also having a similar issues, I don’t think it’s the library, or set ups. I2C SDA and SCL seem to sit at 1.6V even when ESP I2C is configured and that is with internal pull-ups enabled. I confirmed the pull-ups are active by disconnecting they pull up to 3.3V.

Looking at the (limited!) information on the IC, I noticed there are a few silicon variants in the datasheet:

IP2368_BZ IP2368_COUT IP2368_I2C_COUT

IP2363_I2C_COUT is the variant that offers I2C, and is most likely not populated on some of these dev board (including mine!). My board has IP2368 with a marking ending in -1BY, but datasheet doesn’t say what that is, interested to know what everyone else’s are?

This is confirmed at LCSC, where you can buy the _I2C variant as well as others.

https://www.lcsc.com/mobile/products/Power-Management-Specialized_485.html?keyword=Ip2368

Id really love to add a display, so I might swap out the to that IP2368 variant or try to get a board with it.

Thanks for the library, great work. Hope this saves any headaches for people.

ntchris commented 2 months ago

datasheet states there are multiple variants, some can only do LED and some other can do I2C. however, there is no info on how to tell difference of those variants, the print on IC is all the same. just a icon, IP2368, and date batch. this is very strange.

illysky commented 2 months ago

Yeah its a bit annoying.

I think what they might be doing is "binning" the ICs. When they come off the fab at the silicon foundry, they are tested for functionality, and depending on the test result they sort them into bins.

If for instance they find that the I2C is not functioning on one die, they WILL still sell it but market it as "non i2c version". Usually this happens at the wafer level, but in this case they might be "binning" them AFTER they have put them in the epoxy casings and mark the packages.

That's my best guess!

RWBRWB commented 1 month ago

They made me buy special I2C enabled chips for the IP2366 line so was surprised to see the images of him wiring up the LED pins and getting I2C working on the same chip.

If you could get I2C or LED output then I'm not sure why the would have a Chip model number with I2C enabled in it when the other models do not.

I think it depends on what firmware is loaded to the IC's from the factory when made that determine how the pins function and for what purpose they serve.

D-314 commented 4 weeks ago

wiring up the LED pins and getting I2C working

On my ip2368 board LEDs were working before I removed resistors. After I removed resistors and connected wires to specified points I was able to discover 0x75 device at i2c bus. So must probably that function mode is determined during the chip boot.

Also it may be firmware, but I have chip with working LEDs and semi-working i2c (some config registers did not reacts to change or read only, and some status registers contains trash)