cancel
Showing results for 
Search instead for 
Did you mean: 

Configure a IIS328DQ to replace a LIS3LV02DQ

GPres.1
Associate

I have used the LIS3LV02DQ before but it is no longer being made. A new circuit has the IIS328DQ but I can not get it to work as the did. I can successfully get the WHO_AM_I to return and set/read the control registers so I know the SPI is working fine. All I want to do is continuously read the X, Y, and Z values after a Data Ready interrupt.

My code first does a WHO_AM_I, then sets the config registers with CTRL_REG1 = h20 (Normal mode, 50hz, xyz off). Then I read all the registers and print to a terminal, then turn on xzy, read INT1_SRC to clear any interupt 1, then wait for Data Ready. Data ready never happens.

What am I doing wrong? How can I make it work just like a LIS3LV02DQ?

 

Here is what is printed to the termial:

WHO AM I - 32
REG h20 = 20
REG h21 = 00
REG h22 = 82
REG h23 = 80
REG h24 = 03
REG h25 = 00
REG h26 = 00
REG h27 = 00
REG h28 = 10
REG h29 = 01
REG h2A = C0
REG h2B = 01
REG h2C = 10
REG h2D = 3E
REG h2E = 00
REG h2F = 00
REG h30 = 00
REG h31 = 00
REG h32 = 00
REG h33 = 01
REG h34 = 00
REG h35 = 00
REG h36 = 00
REG h37 = 00
SET REG_1 TO h27
INT1_src=0

 

Thanks

1 REPLY 1
Federica Bossi
ST Employee

Hi @GPres.1 ,

You could try to follow our PID examples on github.

Let me know if this helps :)

In order 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.