Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TrVu_4335346
Level 1
Level 1
First like given

i2c_image.png

How can i using EZUSB_WriteI2C() and EZUSB_ReadI2C() functions to read/write Data from Si570 - 570FAB000433DG  such as image?

I am using Keil C and modify firmware of Cypress.  Could you please tell me detail how to read/write data with I2C?

Thank you very much and sorry about my english

0 Likes
1 Solution

Hi,

Please use the following cases when FX2LP is set as I2C master-

Please set I2C_Addr as your Si570 slave address and DB_Addr as 0x00. Please set the LSB in addr to your internal register address. The length should be the size of the data so in this case 0x06.

EEPROMWrite(addr, length, test_array);

This will ensure that the first parameter passed to the function is the internal register address (one byte), second parameter is the length of the actual bytes to be written and the third parameter is the buffer storing the data to be written.

EEPROMRead(addr, length ,(WORD)EP0BUF);

This will ensure that the first parameter passed to the function is the internal register address (one byte), second parameter is the length of the bytes to be read and the third parameter is the buffer storing the read data. Please arm EP0BCL with the length passed on the read function if you would like to read the data on EP0.

Please probe the I2C lines and let us know what is seen if this doesnt work.

Best Regards,

Sananya

View solution in original post

4 Replies