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

I am using the following code for I2C" i2c = I2C(0,scl='P6_0',sda='P6_1',freq=4000000)" I don't know why I got endup in error #92

Closed
kpk31081998 opened this issue Sep 27, 2023 · 8 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@kpk31081998
Copy link

I am using the following code for I2C" i2c = I2C(0,scl='P6_0',sda='P6_1',freq=4000000)" I don't know why I got end up in error the following error "Traceback (most recent call last):
File "", line 1, in
ValueError: I2C initialisation failed with return code 4020d01 !"

please help me to resolve this error

Thank you

@kpk31081998 kpk31081998 added the documentation Improvements or additions to documentation label Sep 27, 2023
@jaenrig-ifx
Copy link
Member

Hi @kpk31081998,

I just tried and I think your freq is too high. Can you make it 400000 (one 0 less)? That works for me.

@IFX-Anusha
Copy link

Hi @kpk31081998 ,

The Maximum allowed frequency is 1Mbps(1^6). Any frequency below should work.

Regards,
Anusha

@kpk31081998
Copy link
Author

kpk31081998 commented Sep 28, 2023

@jaenrig-ifx and @IFX-Anusha Thank you so much for both of you yes it worked when I reduced the frequency now I can see device address as 68 seems its giving the address in decimal and I converted it into hexa and I am using "i2c.readfrom(0x44, 4)" command but I am getting "ValueError: cyhal_i2c_master_read failed with return code aa2004 !" I am new to micro python and I am following [https://ifx-micropython.readthedocs.io/en/latest/psoc6/quickref.html](this documentation) for CY8CPROTO-062-4343W PSoC Board.If you help me to resolve this error and help me to get data from my I2C device that would be very helpful
Thank you

@jaenrig-ifx
Copy link
Member

Hi @kpk31081998,

Can you tell us more about your hardware setup? which i2c slave device(sensor?) are you using? how are you connecting it to the board? are you using pull-up resistors?

Regards,
Juan

@jaenrig-ifx jaenrig-ifx added the help wanted Extra attention is needed label Sep 28, 2023
@jaenrig-ifx
Copy link
Member

Documentation fixed in #93.

@kpk31081998
Copy link
Author

Hi @kpk31081998,

Can you tell us more about your hardware setup? which i2c slave device(sensor?) are you using? how are you connecting it to the board? are you using pull-up resistors?

Regards, Juan

Sorry for the late replay, I am using "Infineon CY8CPROTO-062-4343W" as master and SHT40 as a slave I am not using any pullup resistors I don't know why the above solution of reducing frequency works sometimes and sometimes not. I am getting an error "ValueError: I2C initialization failed with return code 4020d01 !" If you can help me to read data from SHT that would be very helpful
Thank you

@jaenrig-ifx
Copy link
Member

Hi @kpk31081998,

The initialization should initialize properly from software side despite if you have the sensor connected or not. Are you by any chance reusing that pin for any other purpose? Can you describe more the "sometimes"? Is it random? Or under certain changes in your setup?
Maybe you can share the example code or a snippet of it.

@jaenrig-ifx
Copy link
Member

Hi @kpk31081998,

This issue will be closed due to inactivity. It can be reopened if the support is still needed.

@jaenrig-ifx jaenrig-ifx closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants