cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
josephsamson
Explorer
Explorer
861 Views
Registered: ‎10-05-2010

AXI IIC Not Addressed As Slave

Jump to solution

I am trying to detect the repeated start as an AXI IIC slave so that an IIC master can read data from the slave. I have successful slave reads when I use two cycles: a master write that begins with a start condition and ends with a stop condition, followed by a master read that begins with a start condition and ends with a stop condition.

 

Now I want to have a master write that begins with a start condition and ends with a start condition (the repeated start), followed by a master read that ends with a stop condition. When I generate this IIC bus traffic, the IIC Status Handler reports Event 16,  XII_MASTER_WRITE_EVENT, but the receive handler is never called.

 

xiic.h indicates that the Not Addressed As Slave interrupt should call the receive handler:

* The Not Addressed As Slave interrupt is not passed directly to the
* application thru the status callback.  It is used to determine the end of
* a message being received by a slave when there was no stop condition
* (repeated start).  It will cause the receive handler to be called to
* indicate completion of the operation.

I don't see this happening. The receive handler is not being called. 

Is there some additional step that I should be taking to enable the repeated start detection?

 

---

Joe Samson

0 Kudos
1 Solution

Accepted Solutions
josephsamson
Explorer
Explorer
875 Views
Registered: ‎10-05-2010

Solved another one.

 

The AXI_IIC example iic_slave_example.c includes the following code:

 

 

while ((ReceiveComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
	if (SlaveRead) {
		XIic_SlaveRecv(&IicInstance, ReadBuffer, RECEIVE_COUNT);
		SlaveRead = 0;
	}
}

Looping while XIic_IsIicBusy is true will work with a slave receive that ends with a stop condition, but it loops forever when the slave receive ends with a repeated start. When I remove the loop, my the slave receive with repeated start works.

 

---

Joe

 

View solution in original post

0 Kudos
2 Replies
josephsamson
Explorer
Explorer
825 Views
Registered: ‎10-05-2010

A little more information from debugging:

I put a print statement in the AddressedAsSlaveHandler and in the NotAddressedAsSlaveHandler.

When the master writes to the slave (my design is the slave), the following occurs:

 

1. AddressedAsSlaveHandler (corresponding to the I2C Start)

2. I2C Status Handler, XII_MASTER_WRITE_EVENT

3. NotAddressedAsSlaveHandler (corresponding to the I2C End)

4. I2C Receive Handler

 

When the master reads from the slave, the following occurs:

1. AddressedAsSlaveHandler (corresponding to the I2C Start)

2. I2C Status Handler, XII_MASTER_READ_EVENT

3. NotAddressedAsSlaveHandler (corresponding to the I2C End)

4. I2C Send Handler

 

However, when I try a master read from slave with repeated start, the following occurs:

1. AddressedAsSlaveHandler (corresponding to the I2C Start)

2. I2C Status Handler, XII_MASTER_WRITE_EVENT

 

The repeated start does not trigger the NotAddressedAsSlaveHandler 

 

---

Joe

 

0 Kudos
josephsamson
Explorer
Explorer
876 Views
Registered: ‎10-05-2010

Solved another one.

 

The AXI_IIC example iic_slave_example.c includes the following code:

 

 

while ((ReceiveComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
	if (SlaveRead) {
		XIic_SlaveRecv(&IicInstance, ReadBuffer, RECEIVE_COUNT);
		SlaveRead = 0;
	}
}

Looping while XIic_IsIicBusy is true will work with a slave receive that ends with a stop condition, but it loops forever when the slave receive ends with a repeated start. When I remove the loop, my the slave receive with repeated start works.

 

---

Joe

 

View solution in original post

0 Kudos