Not applicable
Mar 21, 2016
02:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2016
02:39 PM
Hi,
I am using the XMC1100 as a slave node. Occasionally I get communication glitches where the XMC1100 continues to hold the SDA low. I have tried toggling SCL until SDA returns to high but the SDA never goes high again.
Can the XMC slave be manually clocked by the master to restore the SDA to high logic level like lots of other I2C devices or does the state machine not allow this?
Is there a reset to restore the SDA level without restarting the MCU?
Thanks,
Joe
I am using the XMC1100 as a slave node. Occasionally I get communication glitches where the XMC1100 continues to hold the SDA low. I have tried toggling SCL until SDA returns to high but the SDA never goes high again.
Can the XMC slave be manually clocked by the master to restore the SDA to high logic level like lots of other I2C devices or does the state machine not allow this?
Is there a reset to restore the SDA level without restarting the MCU?
Thanks,
Joe
2 Replies
Mar 23, 2016
02:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 23, 2016
02:00 AM
Hello Joe,
I would suggest the following recovery sequence for the I2C slave:
Regards,
Min Wei
I would suggest the following recovery sequence for the I2C slave:
/* Disable SDA and SCL output pin functions */
XMC_GPIO_SetMode(SCL_PIN, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
XMC_GPIO_SetMode(SDA_PIN, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
/* Flush the contents of the FIFO */
XMC_USIC_CH_TXFIFO_Flush(I2C_CH_NUM);
XMC_USIC_CH_RXFIFO_Flush(I2C_CH_NUM);
/* Invalidate the internal transmit buffer */
XMC_USIC_CH_SetTransmitBufferStatus(I2C_CH_NUM, XMC_USIC_CH_TBUF_STATUS_SET_IDLE);
/* Re-enable the SDA and SCL output pin functions following the recovery sequence */
XMC_GPIO_SetMode(SCL_PIN, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT2);
XMC_GPIO_SetMode(SDA_PIN, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT2);
Regards,
Min Wei
Not applicable
Mar 23, 2016
08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 23, 2016
08:42 AM
Thanks for the response.
That looks like what is suggested for the SCL lockup in the errata. If SDA is also handled this way, the errata should be updated.
That said, I am trying to understand if the master can attempt to manually send clock signals to recover as well. Is this possible?
Otherwise I have to figure out how the slave is supposed to know when to call this recovery logic.
Thanks,
Joe
That looks like what is suggested for the SCL lockup in the errata. If SDA is also handled this way, the errata should be updated.
That said, I am trying to understand if the master can attempt to manually send clock signals to recover as well. Is this possible?
Otherwise I have to figure out how the slave is supposed to know when to call this recovery logic.
Thanks,
Joe