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

Parents
  • 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
Reply
  • 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
Children
No Data
Related