- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello guys,
I know that this a common error when you are working with i2c and already looked through the all mentioned topics here in community.
Now about the problem:
I'm using max30205 temperature sensor. It's quite simple, only 3 config registers and 1 register with a temperature result.
I was using as a referal example from here https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day031_Dig...
Also I tried another approach with a manual i2c configuration: when you are using I2CMasterSendStart, I2CMasterSendStop. Results are the same: I'm getting an error: bus busy...in some cases when I'm lucky enough some of the initialization steps can be passed but anyway this is not good at all.
Seems like I missed somethig important, like waiting for a bus free before start any activity on the bus, but I didn't find the corresponding status in API to check this.
I really hope that some of you can help me with this problem. Project attached.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Solved. Problem was in pull-up resistors. So here is a solution:
i2c_1_scl_SetDriveMode(i2c_1_scl_DM_RES_UP);
i2c_1_sda_SetDriveMode(i2c_1_sda_DM_RES_UP);
Thank you, Bob for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Line 37 in main.c.
You only read the status once (which will be busy at that time). Move the
status = i2c_1_I2CMasterStatus(); |
line into the while loop.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
yap, sorry I saw that mistake after project was attached to this post. I also checked with a status checker inside the loop -- the same mistake: staying inside the loop with a busy bus status.
Maybe something else that I don't see?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you provide the needed pull-up resistors?
Are you using a Cypress Kit? Which one??
Try to monitor SDA and SCL with a logic analyzer.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you provide the needed pull-up resistors?
Is it possible to enable pull-up by software on the cyble SoC or should I add 1kOhm resistors on the sda/scl directly?
Are you using a Cypress Kit? Which one??
I'm using only such green eval board: CYBLE-022001-EVAL EZ-BLE PRoC Evaluation Board
Try to monitor SDA and SCL with a logic analyzer.
yap, seems like I should analyze what is going on the bus. Today I'll check it with oscilloscope.
By creating this post I just wanted to be sure that in software all looks fine(except that silly mistake with a status checker).
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Solved. Problem was in pull-up resistors. So here is a solution:
i2c_1_scl_SetDriveMode(i2c_1_scl_DM_RES_UP);
i2c_1_sda_SetDriveMode(i2c_1_sda_DM_RES_UP);
Thank you, Bob for your help.