2022-08-28 10:51 PM
I followed these instructions in the LSM6DS3TR-C datasheet.
Reading the WHO_AM_I register I get 6Ah.
A basic SW routine which shows how to enable the pedometer functions is as follows:
1. Write 20h to CTRL1_XL // Turn on the accelerometer
// ODR_XL = 26 Hz, FS_XL = ±2 g
2. Write 14h to CTRL10_C // Enable embedded functions and pedometer algorithm
3. Write 80h to INT1_CTRL // Step detector interrupt driven to INT1 pin
I move the Accelerometer and see steps accumulating.
After 3 minutes of no steps, I put the main Cpu to sleep. LSM6DS3TR-C stays powered.
When steps are detected by simulating steps again, the INT1 wakes up my CPU.
But sending the above commands to the registers reset the pedometer steps even though ****_RST_STEP is 0.
Is there a different setup to be used upon reconnecting to the device?
Why are the steps getting reset using this basic setup?
I reference this document for the basic setup:
AN5130
LSM6DS3TR-C: always-on 3D accelerometer and 3D gyroscope
Thank you,
Trey
2022-09-09 11:02 AM
It appears that using a Seeed XIAO BLE SENSE nrf52840, even though the LSM6DS3TR-C is awake while the XIAO is sleeping, when an interrupt wakes up the XIAO it ends up resetting the GPIO that the LSM6DS3TR-C is connected to. I haven't been able to confirm this, but it appears Seeed is allowing that GPIO to reset upon waking up(reset/boot). the nrf does state GPIO can maintain state, but I'm not sure what Seeed is doing yet.