cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot write any Free Fall bits on ISM330DLCTR

MSchu.11
Associate

Hi all,

We're using the ISM330DLCTR in our design. We have the device set up in "Mode 1." OCS_AUX and SDO_AUX are marked as N/C on the schematic. SDX and SCX are pulled to GND. INT1 and the SPI control lines are going to our application processor.

The issue I'm noticing is that I'm unable to set any bits relating to the FreeFall function. I suspect I'm not able to set bits to the other embedded functions either.

I've read through the Application Note and have followed the steps they recommend:

- Turn on accelerometer via CTRL1_XL

- Enable interrupts and latch via TAP_CFG

- Set high bit of FF_DUR via WAKE_UP_DUR register, if dur that large.

- Set FF_DUR and FF_THS via the FREE_FALL register

- Enable the FF interrupt via a write to MD1_CFG

The problem I'm getting is that the bits relating to Free Fall don't ever set. I'm performing readbacks on all of these registers on write. Anytime I set a '1' to a Free Fall feature, regardless of register, it doesn't stick. I read back a 0 everytime. So FREE_FALL @ 0x5D always returns 0. The relevant bits on 0x5E return 0. I'm able to enable interrupts and latching, but those are general features.

I have fine SPI comms otherwise. the WHO_AM_I register works. This codebase was previously just polling the the X, Y, Z values so I'm fairly sure that works fine. But the free fall feature just won't enable.

I've looked through the application note and haven't found any mention of a flag that must be turned on to enable this feature.

I've gone through both the "RESET" and "REBOOT" steps to try and put the accelerometer in as clean of a state as possible before configuring it, still no luck.

I've tried the "Enable Embedded Functions" bit just in case that was relevant, no luck.

I've made sure the accelerometer isn't in a low power state by turning off the Inactivity feature. I've tried different ODRs. I've tried various states for the gyroscope, although that shouldn't be relevant per the docs. I feel like I've set and cleared just about every unrelated feature that the datasheet mentions, and cannot get these bits to set.

I've looked up other people's source code and haven't come across the smoking bullet I'm missing here.

Does anyone have an idea what I could be missing?

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @MSchu.11​ ,

If the WHO_AM_I register can be correctly read, the issue is not related to the SPI communication. Or better, are you trying to read multiple registers together (so you have to enable that bit during the transmission), or are you just using single-read SPI?

>> I've tried the "Enable Embedded Functions" bit just in case that was relevant, no luck.

This is correct, since the free fall is not an embedded function, so there is no need write specific registers.

Did you have the possibility to check this issue on more than one sample? And did you already compare your code with the examples on Github (ism330dlc_read_data_polling.c)?

-Eleon

Hi Eleon, I'm not sure I understand your recommendation.

Free-fall is tied to an event; an interrupt, correct? It's not tied to a given sample.

>> Did you have the possibility to check this issue on more than one sample? And did you already compare your code with the examples on Github (ism330dlc_read_data_polling.c)?

My issue isn't with sampling the accelerometer. That works okay. I can get raw data from it just fine. My issue is that I'm not able to set any of the free-fall configuration bits.

To keep things as simple as possible I'm doing single-read and single-write SPI. I'm not using any address auto-incrementing or "rounding" features.