- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im experiencing clock latching from I2C slave.
I want to toggle the I2C clock (SCL) a few times to make the slave to release the line.
I couldn't find an API to do so.
How can I do that?
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think that the part which back up the pin configuration and restore it is in the loop
uint32 regVal, regValtemp;
regVal = CY_GET_REG32(I2CM_scl__0__HSIOM);
...
regVal = CY_SET_REG32(I2CM_scl__0__HSIOM, regVal);
So the author of the discussion was
if sda == 0 enter the loop (while)
back up the register setting of SCL
configuring the SCL pin as GPIO
flip SCL once
restore the SCL configuration
After the program exited the loop, it cleans the status of I2C component by calling
status = I2CM_I2CMasterSendStop(timeout);
//Reset I2C
I2CM_I2CMasterClearStatus();
I2CM_I2CMasterClearReadBuf();
I2CM_I2CMasterClearWriteBuf();
Could I make sense?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can the following discussion be some help?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yes, it helps.
I just need few clarifications:
Calling the following functions is enough to reset SCL pin the its default I2C configuration
(in case of "Show I2C terminals" box is UNCHECKED)?:
- I2C_I2CMasterClearStatus();
- I2C_I2CMasterClearReadBuf();
- I2C_I2CMasterClearWriteBuf();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think that the part which back up the pin configuration and restore it is in the loop
uint32 regVal, regValtemp;
regVal = CY_GET_REG32(I2CM_scl__0__HSIOM);
...
regVal = CY_SET_REG32(I2CM_scl__0__HSIOM, regVal);
So the author of the discussion was
if sda == 0 enter the loop (while)
back up the register setting of SCL
configuring the SCL pin as GPIO
flip SCL once
restore the SCL configuration
After the program exited the loop, it cleans the status of I2C component by calling
status = I2CM_I2CMasterSendStop(timeout);
//Reset I2C
I2CM_I2CMasterClearStatus();
I2CM_I2CMasterClearReadBuf();
I2CM_I2CMasterClearWriteBuf();
Could I make sense?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You couldn't make more sense 🙂
Thanks a lot. toggling the clock actually helped and recovered the I2C