HS3001 Receive wrong data

Hi,

I want to transmission HS3001 data through I2C for DA16200.

I can get HS3001 device address but I get error register data.

However enter any register address,data always 0x7F,0xFF,0xFF,0xFD.


I refer to HS300x datasheet operation method(page16.17)


This is code in DA16200.

#define AT_I2C_HS3001_DATA_LENGTH	(4)
#define	AT_I2C_HS3001_LENGTH_FOR_WORD_ADDRESS	(1)

PRINTF("I2C_SAMPLE 3001\n");
HANDLE I2C;
// Device Address for HS3001
UINT32 addr=0x89;
// I2C Working Clock [KHz]
UINT32 i2c_clock = 400;
// Buffer for read from EEPROM
UINT8 i2c_data_read_3001[AT_I2C_HS3001_DATA_LENGTH];
//Initialization Uart
_da16x_io_pinmux(PIN_EMUX, EMUX_I2Cm);
// I2C EEPROM Test
PRINTF("I2C EEPROM Test start ...\r\n");

DA16X_CLOCK_SCGATE->Off_DAPB_I2CM = 0;
DA16X_CLOCK_SCGATE->Off_DAPB_APBS = 0;
// Create Handle for I2C Device
I2C = DRV_I2C_CREATE(i2c_0);
// Initialization I2C Device
DRV_I2C_INIT(I2C);
// Set Address for HS3001
DRV_I2C_IOCTL(I2C, I2C_SET_CHIPADDR, &addr);
// Set I2C Working Clock. Unit = KHz
DRV_I2C_IOCTL(I2C, I2C_SET_CLOCK, &i2c_clock);


i2c_data_read_3001[0]=0x11;
DRV_I2C_READ(I2C, i2c_data_read_3001, AT_I2C_HS3001_DATA_LENGTH, AT_I2C_HS3001_LENGTH_FOR_WORD_ADDRESS, 0);

Parents Reply Children
No Data