This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Interfacing GY-68 with nrf52840

Hello,I am new to this field.I dont know how to interface GY-68 with nrf52840 and read the temperature,pressure and altitude readings.

Parents
  • Hi,

    GY-68 seems to have a I2C interface. The peripheral called TWI on the nRF52840 is compatible witth I2C devices. You can find an example in our SDK that show how to use the TWI driver. You need to look in the datasheet of the sensor to figure out which registers you need to write/read to get data from the sensor.

    Best regards,
    Jørgen

  • Hi,I have gone through datasheet of the sensors(LM75B and BMP180).In twi_sensor code,I have done the following changes:

    #define BMP180_ADDR (0x77U >> 1)

    #define BMP180_REG_OUT_XLSB     0xF8
    #define BMP180_REG_OUT_LSB        0xF7
    #define BMP180_REG_OUT_MSB       0xF6
    #define BMP180_REG_CTRL_MEAS   0xF4
    #define BMP180_REG_SOFT_RESET  0xE0
    #define BMP180_REG_ID                      0xD0
    #define BMP180_REG_CALIB_START 0xAA


    /* Mode for BMP180. */
    #define STD_MODE 1U.

    From the above defined,I used  BMP180_REG_CTRL_MEAS in the place of LM75B_REG_TEMP and BMP180_REG_OUT_XLSB in place of LM75B_REG_CONF.I have used standard mode with value 1U. Is this correct???

    After modification,I can able to build the application but while loading,shows "ERROR FLASH DOWNLOAD FAILED".

    Can anyone help me out

     

Reply
  • Hi,I have gone through datasheet of the sensors(LM75B and BMP180).In twi_sensor code,I have done the following changes:

    #define BMP180_ADDR (0x77U >> 1)

    #define BMP180_REG_OUT_XLSB     0xF8
    #define BMP180_REG_OUT_LSB        0xF7
    #define BMP180_REG_OUT_MSB       0xF6
    #define BMP180_REG_CTRL_MEAS   0xF4
    #define BMP180_REG_SOFT_RESET  0xE0
    #define BMP180_REG_ID                      0xD0
    #define BMP180_REG_CALIB_START 0xAA


    /* Mode for BMP180. */
    #define STD_MODE 1U.

    From the above defined,I used  BMP180_REG_CTRL_MEAS in the place of LM75B_REG_TEMP and BMP180_REG_OUT_XLSB in place of LM75B_REG_CONF.I have used standard mode with value 1U. Is this correct???

    After modification,I can able to build the application but while loading,shows "ERROR FLASH DOWNLOAD FAILED".

    Can anyone help me out

     

Children
Related