Dear all,
I am using MMA9555L sensor for pedometer application, the host processor is iMX6S. I have configured the sensor for pedometer application, but the status registers for stepcount, speed and distance always read as zeros. can someone help me in solving the issue?
Here is the sequence.
Using the user application with I2C-DEV interface
i2c_smbus_write_i2c_block_data() for write ; i2c_smbus_read_i2c_block_data() for read.
//read the version details:
command : 0x00 0x00 0x00 0x0C0x0
Response read from MB0 : 0x80 0xc 0xc 0x60 0x96 0x6e 0xd5 0x1 0x1 0x2 0x2 0x1 0x6 0x3 0x41
//configure for pedometer application
Command: 0x15 0x20 0x00 0x11 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x50 0xAF 0x03 0x04 0x82 0x05 0x01 0x00 0x01
//read config
Command: 0x15 0x10 0x00 0x11
Response : 0x15 0x80 0x10 0x11 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x50 0xaf 0x3 0x4 0x82 0x5 0x1 0x0 0x1
// Read status registers, actually reading in a while loop with 1 second delay
Command: 0x15 0x30 0x00 0x0C
Response : 0x15 0x80 0xc 0xc 0x8 0x1 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Please let me know if anyone faced this issue or if something is missed by me.
Thanks in Adavnce.
Best Regards,
Chiranjeevi
Hi Chiranjeevi,
I guess your issue is due to the fact that MMA955xL device starts by default in Deep Sleep Mode (all clocks stopped). It is responsive to the slave interface commands but the accelerometer and pedometer does not run. You simply need to disable sleep mode (STOPNC) in Sleep-Wake Application by sending: 0x12 0x20 0x06 0x01 0x00. This is mentioned in Section 2.6.12, page 31 of the MMA955xL Software Reference Manual:
Besides this prerequisite to have the pedometer running and counting, I recommend to enter the user characteristics (height, weight, gender) in the configuration registers in order to have optimum estimation for computed parameters (distance, speed, calories…). How are you testing the device?
Also, you can check the attachment to this answer where is explained with detail, the SPI / I2C communication with the MMA955xL.
Regards,
Darío