I am having a difficult time understanding some of accelerometer register entries, what exactly I need to write to them and what do they mean.
To start with, I am trying to program LIS2DE12 accelerometer, I am working with wake-to-sleep, sleep-to-wake function which basically puts accelerometer to low power mode after some time passes and after significant motion, if it passes threshold value, it will wake up for preset time, after which it will again go to low power mode. I configured sensor for this task, but I don't know what values should I write to ACT_DUR (3Fh) and ACT_THS (3Eh) registers. Explanation is unclear for me:
Image source: ST - LIS2DE12 accelerometer datasheet
Let's take ACT_DUR for example, I know that LSB is Least Significant Bit, which is right-most bit in this register, so writing just 00000001 to the register would mean that accelerometer would be awake for (8 * 1 * 1 + 1) / ODR time units? What if I write 11111111 to the register? How long will it be awake then and what will the equation look like? Also, could someone explain this equation from Table 87 in the datasheet (shown above)?
Should I just fill in my ODR and how many bits are written to this register?
It is overall confusing when I see these LSB registers. What does it mean LSB when I can fill up to 8 bits in register? Do all bits count as LSB? If 1 LSB is 16 mg, then what value would I get when I write for example 11001101? LSB is 1 but second bit is 0, or should I take dec number 205 and multiply it by 16 mg to get my value?