Download MMA955xL Intelligent, Motion-Sensing Platform Software

Transcript
High-g/Low-g Application
Example 10-1.
To configure the MMA955xL platform to detect 0g type events, write the following transaction to the
High-g/Low-g application:
1. MB0: Set APP_ID to (0x09).
Selects the Low-g application.
2. MB1: Command to (0x20).
Sends a Write Configuration space command.
3. MB2: Set offset to zero (0x00).
Starts writing configuration values at register 0.
4. MB3: Set count field to (0x04).
5. MB3: Send Data (0x03).
Sends 0x03E8, the 1000 decimal for the acceleration threshold.
6. MB3: Send Data (0xE8).
7. MB3: Send Data (0x08).
Specifies 33 ms.
8. MB3: Send Data (0x17).
Bytes to Send: 0x09, 0x20, 0x00, 0x04, 0x03, 0xE8, 0x08, 0x17.
To determine if the low-g event happened, read the Low g application’s status register. Send the following
command to set up for reading the status register.
Example 10-2.
1. MB0: Set APP_ID to (0x09).
Selects the Low-g application.
2. MB1: Command to (0x30).
Sends a Write Configuration space command
3. MB2: Set offset to zero (0x00).
Starts writing configuration values at register 0.
4. MB3: Set count field to (0x01).
Bytes to Send: 0x09, 0x30, 0x00, 0x01.
Keeping the device flat on the desk, note that only X and Y should report a low-g event. That is indicated
by the two lower bits being set in the status register.
Now read the mailboxes. The expected response to these commands is:
09 80 01 01 03
MB0: APP_ID = 0x09.
MB1: STATUS = 0x80.
Command Complete, no errors.
MMA955xL Intelligent Motion-Sensing Platform Software Reference Manual, Rev. 0
110
Freescale Semiconductor, Inc.