Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123889

Forum Post: RE: Customer's I2C Question

$
0
0

Hi Sivaraj,

The customer has come back with the following that they were able to get the system working. However there is some issues with the RRDY flag. Please help/advise:

"

All is working okay except I cannot clear the RRDY flag once it is set.

I am invoking multiple calls to the driver and the first call is fine, it polls on (RRDY == 1), but when I try to clear RRDY for future transactions, it won't clear.

My understanding of how RRDY works is as follows:

  • RRDY flag is set when the contents of RX FIFO buffer >= FIFO THRSH
  • RRDY flag is cleared by writing a 1 to the RRDY bit in I2C_IRQSTATUS_RAW
  • RRDY flag will be re-asserted if the contents of RX FIFO buffer >= FIFO THRSH


So, RRDY *should* be cleared with the following sequence:

  1. RX THRSH = 2 (I2C_BUF |= (1 << 8))
  1. Read both bytes
  1. Just in case, I clear Tx and Rx FIFOs (I2C_BUF) |= 0x4040)
  1. Clear flag (I2C_IRQSTATUS_RAW &= I2C_IRQSTATUS_RAW_RRDY)
  1. Note that I2C_BUFSTAT = 0x8002, so the RX FIFO is empty, therefore RRDY should not be re-asserted (unless I am mistaken)


So, what am I doing wrong, here?  Why can I not clear the RRDY flag?


"


Viewing all articles
Browse latest Browse all 123889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>