2017-08-29 09:35 AM
Dear all,
I'm writing .cpp driver for Arduino for the LIS3DHH but something seems wrong.
No replies from the accelerometer.
Do you have any suggestion on the SPI correct communication task reading my files?
2017-08-30 02:16 AM
I didn't have chance to try your code yet. But at first glance, can you please try SPI mode 3?
2017-08-30 04:29 AM
Hi Miroslav,
I've found the issue. It was a bad SPI writeRegister procedure.
Attached the files updated.
Now I'm struggling withe the interrupt 1 settings, but this is another
issue.
Thanks
Alessio
________________ Attachments : LIS3DHH.cpp.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyRS&d=%2Fa%2F0X0000000b8B%2FlIWi6xYE216a.HD7s74uNFjzUVBojEOMALzNfNN22qY&asPdf=falseLIS3DHH.h.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyI6&d=%2Fa%2F0X0000000b89%2F8A9hJQ..Byl.qHClsAqj2PgmNAtmHEB.8j2qPDRMJiM&asPdf=false2017-08-30 04:38 AM
,
,
....
this is my actual register setting to oversampling of 32 using the INT1 in opendrain mode (externally pulluped)
♯ define CTRL_REG1 0x80 // Normal mode enable and register address NOT automatically incremented
♯ define CTRL_REG4 0x44 // FIR, BW=235 Hz and Open drain selection on INT1 pin (externally pulluped)
♯ define CTRL_REG5 0x00
♯ define FIFO_CTRL (0x20 + (OSR-1)) // FIFO mode. Stops collecting data when FIFO is full. FIFO threshold level set to OSR
♯ define INT1_CTRL 0x08 // FIFO threshold flag on INT1 pin
♯ define OSR 32 // Oversampling ratio OSR, equal to number of samples to sum
I cannot understand why the INT1 doesn't work.
I checked the register values after writing and they are corrected
What do you think?
Are them right?
2017-08-30 11:56 AM
If I change the DRDY_PULSE = 1, I get the interrupt each value uploaded in the FIFO register.
Instead the I get an interrupt every 910 us => 1.1KHz the accelerometer ODR.
Anyway I'm not able to get the right FIFO interrupt.