I am working with the Aardvark I2C/SPI Host Adapter and the Aardvark Software API (Python). I am using the command aaspi_eeprom.py 0 100 read 0 0 4096. The I2C device I am working with is a PCA9546 translating switch: the address is 0xE0 and the EEPROM I am talking to connects to port 1 of the switch.
What changes do I need to make?
Response from Technical Support:Thanks for your question! Many functional examples are included with our API packages. However, the programs provided are to read, program, and erase AT25080A SPI EEPROM and AT24C02 I2C EEPROM devices, which are used on our accessory board, the I2C/SPI Activity Board.
Our API can be modified for your devices. Looking at the PCA9546 data sheet, here are guidelines to help you get started.
For the device PCA9546 with address 0xE0, we recommend looking at our aai2c_eeprom example file, and then modify that program to perform the required read and write commands for your setup.
Looking at the data sheet, here is some key information:
The PCA9546 device address, 0xE0, is an 8-bit address. All Total Phase I2C products follow the standard 7-bit addressing and 10-bit addressing conventions.
The slave address used should only be the top seven bits. For your requirement, the device address E0 (8 bit address) can be represented as 70 H(7 bit address). For more information on addressing schemes, please refer this knowledge base article, 7-bit, 8-bit, and 10-bit I2C Slave Addressing.
aai2c_eeprom PORT BITRATE write SLAVE_ADDR OFFSET LENGTH
aai2c_eeprom PORT BITRATE zero SLAVE_ADDR OFFSET LENGTH
Here is an example of using the commands for reading from your device:
Setting the bitrate 400 kHz:
Reading from the device:
0010: 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 00
Please let us know if you have additional questions.
Additional resources that you may find helpful include the following:
We hope this answers your questions. If you have other questions about our software, host adapters or other Total Phase products, feel free to email us at sales@totalphase.com. You can also request a demo specific for your application.