I intend to use MCP9808 (i2c temperature sensor).
So, I wrote codes like below.
// Read operation to the lower level driver is 0.
#define I2C_SLAVE_OPERATION_READ (0)
// Write operation to the lower level driver is 1.
#define I2C_SLAVE_OPERATION_WRITE (1)
#define MCP9808_SLAVE_ADDRESS (0x18 << 1)
UINT16 data = 0;
cfa_bsc_Opextended in temperature_sensor_read_16_bit_register always returns CFA_BSC_STATUS_NO_ACK.
I edited a part of temperature_sensor_read_16_bit_register like following:
read_status = cfa_bsc_OpExtended(reg_bytes_to_read, sizeof(reg_bytes_to_read), reg_read_bytes_to_write,
sizeof(reg_read_bytes_to_write), MCP9808_SLAVE_ADDRESS, I2C_SLAVE_OPERATION_READ);
Why do these code work correctly?
Is there anyone who could make temperature_sensor_read_16_bit_register work correctly?
Please tell me what to do.
Solved! Go to Solution.
Hi, arvinds and j.t.
I'm sorry for my late reply.
I could confirm that i2c function which I implemented works correctly by using my self made board and the same code. However, I couldn't identify the cause of the problem...．I apologize.
I'd like to express my deepest appreciation for your help and support, arvinds and j.t.