Tips, Tools and Applications for the Electronic Industry in Europe

Posted on 2018/02/07 by George

How to send large data transactions using the Aardvark I2C/SPI Host Adapter

How can I send large data transactions, messages greater than 64 bytes, using the Aardvark I2C/SPI Host Adapter?

Question from a customer: For a communication scenario, I am using the Aardvark Software API for data transactions. Here is the call that I am using: aa_i2c_write (handle, deviceAddress, AA_I”C_NO_FLAGS, numbytes, bufferin)

If I define numbytes=300, is there a limitation when sending data due to the buffer size of 64 bytes? In other words, I would like to know what is the maximum size of data (number of bytes) that the Aardvark I2C/SPI Host Adapter can process.

Response from Technical Support: For the Aardvark adapter, the buffer space is 64 bytes, and the maximum slave response is 64 bytes. However, the transactions can be much larger. Here are the details:

The size of the I2C and SPI buffers are 16 Kbytes each - they can hold many separate transactions. These buffers are only used when an Aardvark API call is invoked. This buffer size is adequate for your use, as the overall limitation for asynchronous messages is determined by the operating systems internal buffer size.

The Aardvark adapter can reliably send and receive transactions of 4 Kbytes or less as an SPI master or slave. This is due to operating system issues and the full-duplex nature of the SPI signaling.

When configuring Aardvark adapter for Master Write, the maximum message size is 64k (65535) bytes when using 7-bit addressing and 64k-1 (65534) bytes when using 10-bit addressing. For more details about addresses, please refer to this knowledge base article: 7-bit, 8-bit, and 10-bit I2C Slave Addressing.

Please note, the number of bytes that can be written in the API call  aa_i2c_write is 65535.

 

Aardvark I2C / SPI Host Adapter

This entry was posted in aardvark, I2C, spi

by George