Hi,
I am working on a prototype device that has the icm42670 and will use the Significant Motion Detector (SMD). But, I am unable to get the SMD to work. The device otherwise works as expected for temperature, gyroscope and accelerometer.
The registers are setup as follows...
INT_CONFIG (0x06) = 0x04 // This should setup INT1 as latched, open-drain, active low.
APEX_CONFIG1 (0x26) = 0x40 // This should enable the SMD
INT_SOURCE1 (0x2C) = 0x08 // This should route the SMD interrupt to INT1
The INT pin never gets triggered, and additionally the SMD_INT bit (bit 3) INT_STATUS2 (0x3B) never gets set.
The SMD_SENSITIVITY is the default at reset (0) and should have the most sensivity.
At this point I believe the SMD is configured correctly and the SMD should work. Aside from the INT pin not going active the SMD bit in the status register never even gets set.
Perhaps I have misunderstood the data sheet or I have missed some critical config.
Any help or guidance would be greatly appreciated, thank you.
So I read through the AN-000271 app note on how to setup APEX motion. After trying to get the SMD working, which it appears, also requires the pedometer to be setup, still nothing at the SMD_INT bit indicating an SMD event.
To make things simpler I tried setting up just the APEX Tilt functionality as defined in the same app note in section 4. I figured this should be easy enough as it's well contained and not dependent on the pedometer or other config. But even that does not work, no tilt events. This is the code as written directly per the 4.2 initialization procedure.
Not sure what is going on with this device. No issues with getting temperature, gyroscope or accelerometer data from the respective registers. But, the APEX functions don't appear to be working even after following the app note.
@property
def tilt(self):
self._write_u8(_REG_SIGNAL_PATH_RESET, _PWR_RESET)
time.sleep(0.05)
self._write_u8(_REG_ACCEL_CONFIG0, 0x0A )
time.sleep(0.05)
self._write_u8(_REG_PWR_MGMT0, 0x0A )
time.sleep(0.05)
self._write_u8(_REG_APEX_CONFIG1, 0x02 )
time.sleep(0.05)
self._write_u8(_REG_APEX_CONFIG0, 0x01 )
time.sleep(0.05)
# Skip the tilt wait time selection, use the default of 4sec
self._write_u8(_REG_APEX_CONFIG0, 0x04 )
time.sleep(0.05)
self._write_u8(_REG_APEX_CONFIG1, 0x10 )
time.sleep(0.05)
# Setup the INT pin
self._write_u8(_REG_INT_CONFIG, _INT_CONFIG )
time.sleep(0.05)
return