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

cross mob

Hung state on FX2 due to I2C STOP Bit

Hung state on FX2 due to I2C STOP Bit

Anonymous
Not applicable
Question: Why does the FX2 firmware hangs when the STOP bit is set after polling for the STOP bit.

 

Answer:

The following sequence has been found to hang the FX2 8051:

while (I2CS & bmSTOP)
;
I2CS |= bmSTOP;
while (I2CS & bmSTOP)
;

The sequence reportedly hangs on the second 'while' loop. To avoid this, perform some other operation - such as getting bus status - prior to resetting the STOP bit. Calls to the EZ-USB FX2 libraries do not have this particular sequence.

The description of the STOP bit in the FX2 Technical Reference Manual (section 13.4..1) is incorrect. A STOP condition can only be generated immediately after the ACK phase of a transfer. If the bus is idle when the STOP bit is set, the STOP bit will remain set (and no STOP condition will be generated) until after the ACK phase of the next transfer.

0 Likes
157 Views
Contributors