cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with changing control registers of hts221

jh
Associate II
Posted on May 03, 2016 at 18:14

Hi,

I'm using a stm32f469 disco board and a x-nucleo-iks01a1 extension board and I'm trying to set some of the control bits.

I'm able to read all registers over i2c without any problems. But if i try to write any of the control registers nothing is changed.

i also read that i have to enable the sensor by setting the corresponding bit, which of course doesn't work for me either.

The sensor is set to one shot mode (which i want to change) and until i disconnect and reconnect the power supply i always get the same value.

the temp-value is correct and the sensor changes its reading if i warm the chip up by my finger (and dis-/reconnect the power).

I think i read all documentation and i couldn't find any mysterious procedure to go through before configuring the sensor...

Cheers,

--Jens

#hts221 #control-register
6 REPLIES 6
licciardello.anto
Associate II
Posted on May 03, 2016 at 19:16

Hi,

Can you send me the sequence of settings that you are using?

If you want to use the one shot mode,you have to write 0x80 in CTRL_REG1 (0x20h) or 0x84 (BDU enabled) and in order to start a conversion you have to write 0x01  in CTRL_REG2(0x21h).

 

What is the slave address that you are using?

Pay attention : the slave address is BFh for Read I2C transactions and BEh for Write I2C transactions.

Regards

Antonella

jh
Associate II
Posted on May 04, 2016 at 09:22

Hi,

I'm using C# and .net micro framework, which does most of the i2c-communication.

Slave address is 0x5F + R/W-bit --> 0xBE for a write transaction, and 0xBF for a read. And since i'm able to read the registers which involves a write transaction, this seems to be correct.

I've checked the data with my oscilloscope and every little bit checks out.

WHO_AM_I (0Fh) replies correctly with BCh.

AV_CONF (10h): 1Bh

CTRL_REG1 (20h): 0h

CTRL_REG2 (21h): 0h

CTRL_REG3 (22h): 0h

STATUS_REG (27h): 0h

I tried reading the ctrl_reg first and then write my changes, I tried writing without reading first. On the bus it checks out, the write transmission is acknowledged by the slave but nothing changes.

I've seen some examples on the web, even in different programming languages, but when i try the same command sequence nothing changes :\

Thanks for your help,

Cheers,

--Jens

licciardello.anto
Associate II
Posted on May 04, 2016 at 14:32

Hi,

Do you have tried with one only sample?

If yes, can you try with another sample?

What is happen? Is the same behaviour ?

Let me know

Regards

Antonella

jh
Associate II
Posted on May 10, 2016 at 09:23

Hi,

I only have this one example, so i can't try on another one.

Edit: I should receive another board within a week. I'll try then and tell you about it.

Cheers,

--Jens

jh
Associate II
Posted on May 23, 2016 at 11:57

Hi,

I finally had the time to try with another sampe. Sadly, it's exactly the same behaviour.

The control registers cannot be written >:(

Any suggestions?

Cheers,

--Jens

licciardello.anto
Associate II
Posted on May 23, 2016 at 15:08

Hi,

I reviewing all past posts, I don't believe that the bad operating is a problem of the device, but rather of the I2C connections or implementation of the bus.

If I understand correctly, you are using a x-nucleo-iks01a1 extension board with HTS221 soldered on it and stm32f469 disco board.

The  x-nucleo-iks01a1 is compatible with STM32 Nucleo boards and I usually have used this combination without any problems ( for example ‎Nucleo-L152RE or ‎NUCLEO-F401RE ).

The  x-nucleo-iks01a1 is also equipped with Arduino UNO R3 connector and I suppose that you are using this last to connect the extension to the stm32f469 disco board.

To be honest, I have never  used this stm32f469 disco board.

I suggest you to check again the connections for I2C_SDA and I2C_SCL on Arduino &morpho  connector.

The matching on DISCO-F469NI should be PB_8 and PB_9.

Check again the configurations of GPIO used for I2C (you have to use the pull-up of the micro). 

Regards

Antonella