8 years, 5 months ago.

error when try to configure the MCP9808

Hello ,

i try to connect on my STM32F411RE a sensor temperature (MCP9808) via I2C. i followed some examples describe in mbed , but a i get an error try this fonction :

int MCP9808_SENSOR::begin(void){

i2c.frequency(10000);

data_write[0] = MCP9808_REG_CONFIG = 0x01; data_write[1] = 0x00; data_write[2] = 0x00; int status = i2c.write(0x30, data_write, 3 , false);

return status; }

the status return is nack , that mean i got 1 instead of 0.

Is someone i have had this kind of error?

Question relating to:

Test Adafruit MCP9808 on i2c using Nucleo STM32F103 I2C, MCP9808, Nucleo

1 Answer

8 years, 5 months ago.

My first guess is that you are running to fast, try a slower i2c frequency. I was running on a STM32F103, The F411 is a lot faster processor. I have a Nucleo F401 that I could try it on. If you are using the Adafruit MC9808 board, you need to select the address. https://learn.adafruit.com/adafruit-mcp9808-precision-i2c-temperature-sensor-guide/pinouts An address of 0x30 is the default address with no address pins pulled up. It is 0x18 shifted left 1 place.

Does "false" equal 0?

Hi Richard , Thank you for your answer. in my main setup function , i made i check on MANUF_ID and DEVICE_ID register , and its work. i can read ambient temperature from my MCP9808 sensor.

posted by Romuald ADOUKO AKA 01 Dec 2015