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

Problem with communication with HTS221 sensor

Hello Nordic community,

I have a nrf52-DK with SDK15.2.0 and I'm trying to communicate with ST HTS221 sensor. I have the original  STEVAL-MKI141V2 evaluation board.

I use the twi_sensor example, provided in the SDK. I added the hts221 driver from the SDK and used the default functions for initialization:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include "boards.h"
#include "app_util_platform.h"
#include "app_error.h"
#include "nrf_drv_twi.h"
#include "nrf_delay.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "hts221.h"
#include "nrf_twi_mngr.h"
/* TWI instance ID. */
#define TWI_INSTANCE_ID 0
#define MAX_PENDING_TRANSACTIONS 33
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I try to read the whoami register, I get value 0. When I try to read the temperature and humidity data, always get the same value.

I tried to communicate with ST LIS2DH12 accelerometer the same way with the same example and everything is normal. Is it possible the problem to be in the hts221 libraries?