1 2 Previous Next 15 Replies Latest reply on Mar 30, 2015 12:26 AM by userc_16079

    How can I use i2c in BCM20737S?

      Hi all


      I intend to use MCP9808 (i2c temperature sensor).


      So, I wrote codes like below.

      ==================in Constants========================

      // 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)




      ==============in timer_1s()============================

      UINT16 data = 0;

      temperature_sensor_read_16_bit_register(0x05, &data);




      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.




        1 2 Previous Next