Quantcast
Channel: Total Phase Blog
Viewing all articles
Browse latest Browse all 822

How Should I Set Up the Slave Mode on the Aardvark I2C/SPI Host Adapter for Correct Communication with an I2C Master Device?

$
0
0

Question from the Customer:

I am using the Aardvark I2C/SPI Host Adaptor as an I2C Slave. Will you please help me understand the results I’m getting? Included are screenshots from the Control Center Serial Software .

  1. Why does the Master WRITE operation show in the transaction window as READ (assuming “R” is Read).
  2. I am trying to READ three bytes from the Slave device, but it seems like the slave sends garbage data, any ideas?

The setup:

  • The I2C bus bit-rate is 100K
  • The I2C Master sends the address (0x5E, READ request)
  • The Slave responds with ACK but the first data bit is HIGH.  I assume it has sent its data, but the data looks damaged.
158750-ControlCenterSetup

The results:

  • The Master request is to read two bytes. But instead, the Slave replies only to the first byte (Slave sends 0x02, master reads as 0x81, 0xBF).  Using a scope, I verified the Master reading is correct.
 158750-ControlCenterA

Response from Technical Support:

Thanks for you questions! About the Master WRITE, the transaction window gets the adapter according to the Master/Slave setting of the Aardvark.

  • If Aardvark is configured as a slave, the bytes sent by master are "Read" by the Aardvark slave, which is represented with “R.”
  • When the Aardvark slave sends a response to the master, that transaction is represented with "W" as a Write

About the results:

  • Based on what you described, make sure the Slave response is set before enabling the Slave. If the response is not set before the Slave is enabled, it is possible that a Slave response will be requested before the Slave device has one to return.
  • We also recommend setting the Max Tx.Bytes field to the actual packet size. We suggest referring to the data sheet of the Master device and verifying  how many bytes the Master requests.

Additional resources that you may find helpful include the following:

We hope this answers your questions. If you have other questions about your project, our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com, or if you already own one of our devices and have a technical question, please submit a request for technical support.


Viewing all articles
Browse latest Browse all 822

Trending Articles