IIC question

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
SCL is pulled down while an USIC interrupt is serviced?
0 Likes
4 Replies
Not applicable
Depends on what kind of interrupt service you are evoking.
0 Likes
Not applicable
Pulled down? This the clock.
0 Likes
chismo
Employee
Employee
First like received
Hello,

Generally, I would say no, the USIC interrupt does not hold SCL low.

One scenario where it may appear so is during a slave read request:
- Master sends the start condition, slave address and read request.
- Addressed slave detects the read request and triggers the SRR interrupt.
- In the SRR service routine, the data for transmission to master is written to TBUF.
- The slave holds SCL low while waiting for the data to be written to TBUF, and not because of any interrupts.

Maybe you can provide more details to the scenario that you encountered?

Regards,
MIn Wei
0 Likes
Not applicable
1. In your scenario holding SCL low is made by IIC protocol handler or by the user program?
2. Another question: IIC master receive scenario:

For slave transmit on slave I have the following data loop. But I don't know how to add a wait loop for master ACK because the documentation says PSR.ACK set only on master


while (!(USIC0_CH1->PSR & USIC_CH_PSR_SCR_Msk)) ;
USIC0_CH1->PSCR |= USIC_CH_PSR_SCR_Msk;

for (i=0; i while (USIC0_CH1->TCSR & USIC_CH_TCSR_TDV_Msk) ;
USIC0_CH1->PSCR |= USIC_CH_PSR_TBIF_Msk;

flags = XMC_I2C_CH_TDF_SLAVE_SEND << 8U;
USIC0_CH1->TBUF[0] = data | flags;

}
0 Likes