Skip to main content
AraceliGuerrero
Associate II
September 27, 2023
Question

IIS2MDC always on Idle Mode

  • September 27, 2023
  • 1 reply
  • 2014 views

Hi!

I'm exploring the X-NUCLEO-IKS02A1 with the IIS2MDC magnetometer.

My purpose is read the output data, but I haven't even been able to read the temperature. I'm using I2C through PB8 and PB9 pins, and I have communication cuz' the sensor responds to the command "Who Am I"

After hours of trying, I thought I would read configuration registers A, B and C and I noticed that these are not being affected with my previous writing.

Even worse, register A always reads bits MD0 and MD1 to 1, which means idle mode.

 

Could the board be locked for use without libraries? The same thing happens with the rest of the sensors.

This topic has been closed for replies.

1 reply

Foued_KH
ST Employee
September 28, 2023

Hello @AraceliGuerrero , 

Could you please try this : 

uint8_t temp [2] = {0x2B,0x2C}; /* temperrature registers */
HAL_I2C_Mem_Read(&hi2c1, ,DevAddress, temp ,2, Buffer, 2);


Also you can check this lib :stm32-iis2mdc/iis2mdc_reg.c at main · STMicroelectronics/stm32-iis2mdc · GitHub

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AraceliGuerrero
Associate II
September 28, 2023

Hi Foued,

The temperature continues to read 0. Thanks for the lib, I'll explore it.

Foued_KH
ST Employee
September 28, 2023

Hi @AraceliGuerrero , 

Could you please share with me the main.c file 

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.