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

Thingy:91's ADXL372 instant on high treshold issue

Hi.

I'm having issues setting the instant on high threshold on the ADXL372 on the Thingy:91. I'm new to this, so I might be missing something obvious. I've updated the thingy firmware as specified on the getting started page. I'm setting the bit like this with the zephyr driver provided:

adxl372_reg_write_mask(dev_372, 
                    ADXL372_POWER_CTL,
        			ADXL372_POWER_CTL_INSTANT_ON_TH_MSK,
        			ADXL372_POWER_CTL_INSTANT_ON_TH_MODE(ADXL372_INSTANT_ON_HIGH_TH));

And have ensured that the 5th bit in the power control register (0x3F) is set before putting it into instant on mode, and that it stays that way.

adxl372_reg_write_mask(dev_372, 
                    ADXL372_POWER_CTL,
                    ADXL372_POWER_CTL_MODE_MSK,
                    ADXL372_POWER_CTL_MODE(ADXL372_INSTANT_ON));

From what i understand this is in accordance with the data sheet. Nevertheless the trigger seems to be just as sensitive when this bit is set, although the threshold should be 10-15g for low and 30-40g for high.

I've also tried to modify the driver in order so set the the accelerometer into high threshold from the start, but that doesn't seem to make a difference. Any insight to what could cause the issue, or what I am missing would be much appreciated. Im on NCS 1.4.0, but also tested briefly with a newer version.

-Sigurd

  • Hello, 

    The latest official release is NCS v1.5.0, which was released yesterday.

    What application are you working on? Have you looked at our Asset Tracker application? Or the Zephyr ADXL372 sample found in: zephyr\samples\sensor\adxl372\
    Both samples uses the Sensors API (zephyr\include\drivers\sensor.h) to read from this sensor.

    Let me know how that works for you. 

    Kind regards,
    Øyvind

  • Yes, I've looked at both of those, and the program I'm working on is based on the ADXL372 sample. I'm using the sensor api to fetch data/read from the sensor and have no issues with that.

    The only issue i have is that when setting the the ADXL372 into INSTANT_ON mode (where it wakes from a low power sleep like state when it detects an impact) it doesn't seem to make a difference if I set the trigger to be high (30-40g) rather than low (10-15g) which is the default. It wakes up and starts to spit out data by equally light impacts. 

  • I'm afraid you need to ask the Zephyr support channels for this issue. Does not look like we have any official working NCS samples. The Zephyr samples are usually made by the Zephyr community 

    Have a look at the Zephyr Community Support pages.

    I'm sorry for the inconvenience.

    Kind regards,
    Øyvind 

  • Hey Sigurd, I have no real answer to your question, but I also want to work in instant on mode. I have one question, you say: 

    And have ensured that the 5th bit in the power control register (0x3F) is set before putting it into instant on mode, and that it stays that way.

    how do you make sure that it stay's that way? Are you using the 

    adxl372_reg_read function from the driver (adxcl372.c)? If you do that, have you added this to the header? I have the Problem that I could not use any of the functions in the adxcl372.c, expect the 4 ones which are mentionend in adxcl372.h (with the 
    CONFIG_ADXL372_TRIGGER Guard around): 

    adxl372_get_status
    adxl372_reg_write_mask
    adxl372_trigger_set
    adxl372_init_interrupt

    when I try to add some more of the adxcl372.c file my programm becomes very unstabel. I also do not find any information on how use sensors in Zephyr without the sensor API, It seems for me that it is not intended by "Zephyr" to use low level functions directly in application code. But I also don't see any option to set the instant on mode and configure the fifos using the sensor.h api. According to this thread here: 

    https://github.com/zephyrproject-rtos/zephyr/issues/13718


    FiFO managmement don't seem to be a part of the sensor API at the moment in Zephyr.
    But maybe I get things wrong, I don't know.

    It also seems to be no Kconfig Option for Instant On mode, only for Measurement or for Peak Mode.
    I have not been able to figure out how Zephyr does the initial config of the sensor in these two modes either.
    it seems like you might be further along than me, so if you have an answer to any of these questions, I'd be very grateful.

    Otherwise, it could also be that your two commands alone do not set the Instant On mode at all and you therefore think that only the threshold is set incorrectly? Do you start with CONFIG_ADXL372_MEASUREMENT_MODE=y in your proj.conf? I read in the datasheet that this mode have to be enabled before the sensor could be set in instant on mode.

    Thanks in Advance.
    Best Regards Rudolph
Related