Home

MMA955xL Intelligent, Motion-Sensing Platform Software

image

Contents

1. Register Resets Offset Name Application Bits 7 6 Bits 5 0 0x00 Version 0x2C sched_parms_APP_ID_0x00 Scheduler 0x00 0x00 0x2D sched_parms_APP_ID_0x01 0x00 0x17 Ox2E sched parms APP ID 0x02 Communications 0x03 0xD7 0x2F sched_parms_APP_ID_0x03 GPIO 0x03 0xD7 0x30 sched parms APP ID 0x04 Mailbox 0x03 0x17 0x31 sched parms APP ID 0x05 Reserved 0x32 sched parms APP ID 0x06 AFE 0x03 0xD7 0x33 sched parms APP ID 0x07 Portrait Landscape 0x00 0x00 Detection 0x34 sched parms APP ID 0x08 High g Detection 0x00 0x00 0x35 sched parms APP ID 0x09 Low g Detection 0x00 0x00 0x36 sched parms APP ID 0x0A Tap Detection 0x00 0x00 0x37 sched parms APP ID OxOB Tilt 0x00 0x00 0x38 sched parms APP ID OxOC User application 0x00 0x00 0x39 sched parms APP ID OxOD User application 0x00 0x00 Ox3A sched parms APP ID OxOE Frame Counter 0x00 0x00 Ox3B sched parms APP ID OxOF Data FIFO 0x03 0xD7 0x3C sched_parms_APP_ID_0x10 Event Queue 0x03 OxD7 0x3D sched parms APP ID Ox11 Status Register 0x03 0xD7 Ox3E sched_parms_APP_ID_0x12 Wake Sleep 0x03 0xD7 Ox3F sched_parms_APP_ID_0x13 User application 0x00 0x00 0x40 sched parms APP ID Ox14 User application 0x00 0x00 0x41 sched parms APP ID 0x15 User application 0x00 0x00 0x42 sched parms APP ID 0x16 User application 0x00 0x00 0x43 sched parms APP ID 0x17 Reset Suspend Clear 0x03 OxD7 0x44 sched parms APP ID 0x18 Mailbox Configuration
2. Field APP ID MBOX 15 Byte ID MBOX 15 Reset 0x00 0x00 Offset 0x18 0x19 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP_ID MBOX_16 Byte_ID MBOX_16 Reset 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 69 Mailbox Application Table 7 1 MBOX registers continued Offset Ox1A 0x1B Bit 7 6 5 4 3 2 1 6 5 4 3 2 1 Field APP ID MBOX 17 Byte ID MBOX 17 Reset 0x00 0x00 Offset 0x1C 0x1D Bit 7 6 5 4 3 2 1 6 5 4 3 2 1 Field APP_ID MBOX_18 Byte_ID MBOX_18 Reset 0x00 0x00 Offset Ox1E Ox1F Bit 7 6 5 4 3 2 1 6 5 4 3 2 1 Field APP ID MBOX 19 Byte ID MBOX 19 Reset 0x00 0x00 Offset 0x20 0x21 Bi 7 6 5 4 3 2 1 6 5 14 3 2 1 Field APP_ID MBOX_20 Byte_ID MBOX_20 Reset 0x11 Defaults to Status Register application 0x00 Status application MSB Offset 0x22 0x23 Bit 7 6 5 4 3 2 1 6 5 4 3 2 1 Field APP ID MBOX 21 Byte ID MBOX 21 Reset 0x11 Defaults to Status Register ap
3. Field output FRONTEND_Stage_0_HPF Z output FRONTEND_Stage_0_HPF Z Reset 0x00 0x00 Table 8 25 output FRONTEND Stage 0 HPF XYZ bit description Field Description output Normalized accelerometer data sampled at the default rate of 488 Hz mode with configurable FRONTEND Stage 0 HPF high pass filter cutoff XYZ Units 0 244 mg LSB Range of valid values 32 768 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 92 Freescale Semiconductor Inc 8 3 7 This register s bits are shown output temp in the following table Table 8 26 output temp registers Analog Front End Application Offset 0x24 MSB 0x25 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output temp output temp Reset 0x00 0x00 Table 8 27 output temp bit description Field Description output temp Temperature sensor output measurement Units ADC counts Range of valid values 32 768 to 32 767 8 3 8 output EIC This register s bits are shown in the following table Table 8 28 output EIC registers 0x26 MSB 0x27 LSB Offset Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output_EIC output_EIC Reset 0x00 0x00 Table 8 29 output_EIC bit description Field Description
4. Field output FRONTEND Stage 0 LPF Y output FRONTEND Stage 0 LPF Y Reset 0x00 0x00 Offset 0x1C MSB Ox1D LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_0_LPF Z output FRONTEND Stage 0 LPF Z Reset 0x00 0x00 Table 8 23 output FRONTEND Stage 0 LPF XYZ bit description Field Description output Normalized accelerometer data sampled at the default rate of 488 Hz mode with configurable FRONTEND Stage 0 LPF low pass filter cutoff XYZ Units 0 244 mg LSB Range of valid values 32 768 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 91 Analog Front End Application 8 3 0 output FRONTEND Stage 0 HPF XYZ These registers bits are shown in the following table Table 8 24 output FRONTEND Stage 0 HPF XYZ registers Offset 0x1E MSB Ox1F LSB gia la a llar AIR a a a AO Field outputiFRONTEND_Stage_0_HPF X output FRONTEND Stage 0 HPFJ X Reset 0x00 0x00 Offset 0x20 MSB 0x21LSB Bt 7 6 5 4 3 2 1 PNEU EE UE EET 0 Field Output FRONTEND Stage 0 HPFJ Y output FRONTEND Stage 0 HPF Y Reset 0x00 0x00 Offset 0x22 MSB 0x23 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
5. MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 81 Analog Front End Application Table 8 4 Cut off frequency as a function of K and the sample rate for high pass filter HPF cut off frequency Hz Samplerate Sample rate Sample rate Sample rate Sample rate Sample rate Sample rate Sample rate 488 28 244 14 122 07 61 04 30 52 15 26 7 63 3 81 1 31 932 15 966 7 9831 3 9915 1 9958 0 9979 0 4989 0 2495 2 17 405 8 7023 4 3511 2 1756 1 0878 0 5439 0 2719 0 136 3 9 1573 4 5787 2 2893 1 1447 0 5723 0 2862 0 1431 0 0715 4 4 7092 2 3546 1 1773 0 5887 0 2943 0 1472 0 0736 0 0368 5 2 3912 1 1956 0 5978 0 2989 0 1495 0 0747 0 0374 0 0187 6 1 2054 0 6027 0 3014 0 1507 0 0753 0 0377 0 0188 0 0094 7 0 6051 0 3026 0 1513 0 0756 0 0378 0 0189 0 0095 0 0047 8 0 3026 0 1513 0 0757 0 0378 0 0189 0 0095 0 0047 0 0024 9 0 1513 0 0757 0 0378 0 0189 0 0095 0 0047 0 0024 0 0012 10 0 0756 0 0378 0 0189 0 0095 0 0047 0 0024 0 0012 0 0006 11 0 039 0 0195 0 0098 0 0049 0 0024 0 0012 0 0006 0 0003 12 0 0195 0 0098 0 0049 0 0024 0 0012 0 0006 0 0003 0 0002 13 0 0098 0 0049 0 0025 0 0012 0 0006 0 0003 0 0002 8E 05 14 0 0049 0 0025 0 0012 0 0006 0 0003 0 0002 8E 05 4E 05 15 0 0024 0 0012 0 0006 0 0003 0 0002 8E 05 4E 05 2E 05 MMA955xL Intelligent Motion Sensing Platform Software Referenc
6. Offset 0x05 Bit 7 6 5 4 3 2 1 0 Field tap K HP Reset 0x05 Table 11 10 tap K HP bit description Field Description tap K HP High pass filter s configurable cutoff 7 0 For high pass filter K values see Table 8 4 on page 82 Units None Range of valid values 0 to 15 Value of zero means no filter 11 2 6 tap K LP Table 11 11 tap K LP register Offset 0x06 Bit 7 6 5 4 3 2 1 0 Field tap K LP Reset 0x04 Table 11 12 tap K LP bit description Field Description tap K LP Low pass filter s configurable cutoff 7 0 For high pass filter K values see Table 8 3 on page 81 Units None Range of valid values 0 to 15 Value of zero means no filter MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 122 Freescale Semiconductor Inc Tap Detection Application Description 11 2 7 tap axis enable Table 11 13 tap axis enable register Offset 0x07 Bit 7 6 5 4 3 2 1 0 Field Reserved Z enable Y enable X enable Reset 0x00 1 1 1 Table 11 14 tap axis enable bit descriptions Field Description Reserved Bit field reserved 7 3 Z enable Enables or disables detection of each axis Y enable Units Non dimensional X enable Range of valid values 0 to 255 2 0 0 Disables the axis
7. Freescale Semiconductor Inc 23 Introduction Table 2 2 Freescale provided applications registers continued i GPIO application APP ID 0x03 Address Width bits Register Name 0x00 8 APP ID for GPIO6 0x01 8 SR Bit for GPIO6 0x02 8 APP_ID for GPIO7 0x03 8 SR Bit for GPIO7 Configuration 0x04 8 APP ID for GPIO8 0x05 8 SR Bit for GPIO8 0x06 8 APP ID for GPIO9 0x07 8 SR Bit for GPIO9 0x08 0x09 16 GPIO pol Polarity control bits Address Width bits Register Name Status None 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 24 Freescale Semiconductor Inc Introduction Table 2 2 Freescale provided applications registers continued i Mailbox application APP ID 0x04 Address Width bits Register Name 0x00 0x01 16 Mailbox 4 APP ID and Byte ID 0x02 0x03 16 Mailbox 5 APP ID and Byte ID 0x04 0x05 16 Mailbox 6 APP ID and Byte ID 0x06 0x07 16 Mailbox 7 APP ID and Byte ID 0x08 0x09 16 Mailbox 8 APP ID and Byte ID 0x0A 0x0B 16 Mailbox 9 APP ID and Byte ID 0x0C 0x0D 16 Mailbox 10 APP_ID and Byte ID Ox0E 0x0F 16 Mailbox 11 APP_ID and Byte ID 0x10 0x11 16 Mailbox 12 APP_ID and Byte ID 0x12 0x13 16 Mailbox 13 APP_ID and Byte ID 0x14 0x15 16 Mailbox 14 APP_ID and Byte ID
8. Legend Bold text Triggered events Italicized text Configuration settings Figure 11 2 Two single tap detection sequence When the signal coming from the LP filter crosses above the tap thresh and continues higher for more time than tap on min and less time than tap on max the application captures the tap event Subsequently the signal must be lower than the tap thresh until the double tap min time is reached When all of these conditions occur the tap detection event is triggered and reported MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 118 Freescale Semiconductor Inc Tap Detection Application i Double tap event triggered I tap_max me lap max l Double tap min time tap_min tap min I l NAE E WIN i 3 l 9 i AG 2 MN hf e M AA J L b 4 tap thresh l l aM gd l l l l l First tap Second tap JI Time l _ I c gt o Legend Bold text Triggered events Italicized text Configuration settings Figure 11 3 Double tap detection sequence For double tap detection the sequence is almost identical Just after the first tap has been detected however and before the double tap min time has expired a second input signal rises above the tap thresh magnitude The application evaluates the second tap to determine if it is valid or not If both taps are valid the al
9. 100 Landscape left Device is in the landscape mode to the left Reports a new back or front orientation event Range of valid values PL BAFRO 00 Undefined This is the default power up state 01 Front Device is in the front facing orientation 11 Back Device is in the back facing orientation MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 168 Freescale Semiconductor Inc Chapter 17 Sleep Wake Application 17 1 Overview of Sleep Wake application This application configures and controls the power control modes of the accelerometer provides configuration flexibility for minimizing power consumption The application has three modes of operation Run Doze and Sleep The Sleep Wake module puts the accelerometer into Doze mode automatically when no movement is detected When a change in orientation or movement above the threshold is detected for the specified time period the application returns to the Run mode cum 0x12 Default speed 488 Hz Configuration Start on registers page 172 Status Start on registers page 176 To save a significant amount of power only run the calculation intensive applications when the accelerometer is in motion Using the activity level settings some tasks may easily be bypassed when the accelerometer is sleeping For example it may not be necessary to run the Portrait Landscape application while th
10. 12 13 14 MBO Set APP ID to OxOF Selects the Data FIFO application MB1 Command to 0x20 Command is a Write Configuration space MB2 Set offset to zero 0x00 Start writing configuration values at register 0 MB3 Set count field to 0x0A Sends nine bytes MBA Send Data 0x0C Sends six bytes free run mode MBS Send Data 0x00 MB6 Send Data 0x00 MB7 Send Data 0x00 MBS Send Data 0x00 MB6 Send Data 0x3C Reserves 60 bytes 10 packets of six bytes each MB7 Send Data 0x06 Associates APP ID AFE MBS Send Data 0x00 MB6 Send Data 0x00 MB7 Send Data 0x00 Bytes to Send OxOF 0x20 0x00 Ox0A OxOC 0x00 0x00 0x00 0x00 0x3C 0x06 0x00 0x00 0x00 The configuration registers can only be written once To reconfigure the FIFO the device first must be reset Read the FIFO applications status register to get the data Send the following command to set up for reading the status register Example 14 2 MBO Set APP ID to OxOF Selects the Data FIFO application MB1 Command to 0x30 Sends a Read Status space command MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 139 Data FIFO Application 3 MB2 Set offset to zero 0x03 Starts reading the configuration values from register 0x03 4 MB3 Set count field to Ox0A Reads 10 bytes three status bytes one
11. Host communicating to MBOX Application Read Output Data command Starting at Offset 0x1A the hexadecimal offset for mailbox 26 Number of bytes to read 6 bytes two bytes each for X Y andZ MSB X LSB X MSB Y LSB Y MSB Z LSB Z Bytes to send 0x04 0x30 Ox1A 0x06 Ox__ Ox__ Ox__ Ox__ Ox__ Ox MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 76 Freescale Semiconductor Inc Chapter 8 Analog Front End Application 8 1 Overview of Analog Front End application 7PP cetion 0x06 The Analog Front End application AFE samples raw accelerometer data from the analog to digital converter ADC at the execution rate of the Default speed 488 Hz application applies factory and user trim correction terms and filters data Configuration Start on to several configurable bandwidths registers page 83 Status Start on registers page 87 Outputs Analog Front End Ba Sample rate 488 100 Hz ff Scal Anti aliasi Normalized ADC data Ol set cale nti a iasing Normalize correction correction filter 488 100 Hz Anti aliasing Normalized filter 244 50 Hz ABS Absolute value 488 100 Hz Configurable Normalized 488 Hz low pass filter Low pass filter Configurable Normalized 488 Hz high pass filter High pass filter Temperature Temperature output Configurable low pass filter External input External
12. MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 97 Portrait Landscape Application 9 2 Portrait Landscape configuration registers 9 2 1 threshold tilt Table 9 1 threshold tilt register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field threshold tilt Reset 0 0 1 0 0 0 1 1 Table 9 2 threshold tilt bit description Field Description threshold tilt Determines the angle of the Z axis at which the application enters and exits the lock out state Units Degrees Range of valid values 0 to 90 9 2 2 landscape angle Table 9 3 landscape angle register Offset 0x01 Bit 7 6 5 4 3 2 1 0 Field landscape angle Reset 0 0 1 0 1 1 0 0 Table 9 4 landscape angle Bit Description Field Description landscape angle Determines the angle in the X Y plane at which the application changes between portrait and landscape Units Degrees Range of valid values 0 to 90 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 98 Freescale Semiconductor Inc Portrait Landscape Application 9 2 3 portrait angle Table 9 5 portrait angle register Offset 0x02 Bit 7 6 5 4 3 2 1 0 Field portrait angle Reset 0 0 1 0 1 1 0 1 Table 9 6 portrait angle bit description Field Description
13. portrait angle Determines the angle in the X Y plane at which the application changes between landscape and portrait Units Degrees Range of valid values 0 to 90 9 2 4 debounce count Table 9 7 debounce count register Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field debounce count Reset 0 0 1 0 0 0 0 0 Table 9 8 debounce count bit description Field Description debounce count Sets the number of continuous counts required in a state before changing to the new state This avoids false decisions of position for high frequencies Units Samples Range of valid values 0 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 99 Portrait Landscape Application 9 2 5 hysteresis LO Table 9 9 hysteresis LO register Offset 0x04 Bit 7 6 5 4 3 2 1 0 Field hysteresis LO Reset 0x00 Table 9 10 hysteresis LO bit description Field Description hysteresis LO Configures the hysteresis for the lockout state Units Degrees Range of valid values 5 to 40 9 2 6 hysteresis BAFRO Table 9 11 hysteresis BAFRO register Offset 0x05 Bit 7 6 5 4 3 2 1 0 Field hysteresis BAFRO Reset 1 0 1 0 1 1 1 1 Table 9 12 hysteresis BAFRO bit description Field Description hysteresis BAFRO
14. 0 Disables the reset sequence of the GPIO application 3 1 Initiates the reset sequence of the GPIO application Command Interpreter 0 Disables the reset sequence of the command interpreter application 2 1 Initiates the reset sequence of the command interpreter application Scheduler 0 Disables the reset sequence of the scheduler application 1 1 Initiates the reset sequence of the scheduler application General Reset 0 Disables a system wide reset sequence of all MMA955xLapplications 0 1 Initiates a system wide reset sequence of all MMA955xLapplications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 180 Freescale Semiconductor Inc 18 2 2 Suspend configuration register Reset Suspend Clear Control Application Table 18 3 Suspend registers Offset MSB 0x04 reset bits 31 24 Bit 31 30 29 28 27 26 25 24 Field Reserved User User User User User User Application Application Application Application Application Application Reset 1 1 1 1 1 1 1 1 Offset 0x05 reset bits 23 16 Bit 23 22 21 20 19 18 17 16 Rst Susp Clr User User User User Auto Wake Status Event FIFO Field Phe SE i i Application Application Application Application Sleep Reset 0 1 1 1 1 1 1 1 Offset 0x06 reset bits 15 8 Bit 15 14 13 12 11
15. 1 Enables the axis 11 2 8 tap events mask Table 11 15 tap events mask registers Offset 0x08 Bit 7 6 5 4 3 2 1 0 A Reserved Tap Field DTap mask Reset 0x00 0 Table 11 16 tap events mask bit description Field tap events mask Masks a specific event of the application to be pushed into the event queue Units Non dimensional Range of valid values 0 to 255 0 Disables event to be pushed into the event queue 1 Enables event to be pushed into the event queue MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 123 Tap Detection Application 11 3 Tap Detection status registers 11 3 1 TAP Out Table 11 17 TAP Out register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field TAP Z Dir Z Ev Y Dir Y Ev X Dir X Ev Reset 0 0 0 0 0 0 0 0 Table 11 18 TAP Out bit description Field Description TAP Reports whether a tap event has been detected 0 Event not detected 1 Event detected Z Dir Indicates the direction of the Z axis event 0 Event in positive direction 1 Event in negative direction Z Ev Reports whether a Z Axis event has been detected 0 Event not detected 1 Event detected Y Dir Indicates the direction of the Y axis event 0 Event in positive direction 1 Event in negative direction Y Ev Reports whether a X Axis event has been detected
16. conversion Figure 8 1 Front end signal processing MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 77 Analog Front End Application 8 1 1 Sample rate The rate at which the ADC samples the accelerometer data is defined by the sfd rate register which is offset OxOC in the configuration registers of this application The sample rate can be changed from 488 Hz to 3 81 Hz by setting the appropriate value in the sfd rate register For more details see Example 8 12 on page 86 and Table 8 13 on page 86 NOTE Although the sample rate can be changed in the hardware it is recommended that the 488 Hz sample rate not be changed because the system s other applications expect the sample rate to be 488 Hz 8 1 2 Offset and scale correction The AFE s offset and scale correction stages of the signal chain applies trim offset and scaling correction factors which were measured at factory calibration and stored inside each device Since user offsets are defined at 8 g resolution those offsets are shifted according to the g mode User offsets are used to calibrate and compensate for the physical mounting of the part inside the final product After board mount and assembly the final test process may include a test to fine tune and compensate the accelerometer orientation 8 1 3 Anti aliasing filter After trim correction the front end uses a sixth order Chebyshev filter runnin
17. 0 Event not detected 1 Event detected X Dir Indicates the direction of the X axis event 0 Event in positive direction 1 Event in negative direction X Ev Reports whether a X Axis event has been detected 0 Event not detected 1 Event detected MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 124 Freescale Semiconductor Inc Tap Detection Application 11 3 2 DTAP Out Table 11 19 DTAP Out register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field DTAP Z Dir Z Ev Y Dir Y Ev X Dir X Ev Reset 0 0 0 0 0 0 0 0 Table 11 20 DTAP Out bit description Field Description DTAP Reports whether a double tap event has been detected 0 Event not detected 1 Event detected Z Dir Indicates the direction of the Z axis event 0 Event in positive direction 1 Event in negative direction Z Ev Reports whether a Z Axis event has been detected 0 Event not detected 1 Event detected Y Dir Indicates the direction of the Y axis event 0 Event in positive direction 1 Event in negative direction Y Ev Reports whether a X Axis event has been detected 0 Event not detected 1 Event detected X Dir Indicates the direction of the X axis event 0 Event in positive direction 1 Event in negative direction X Ev Reports whether a X Axis event has been detected 0 Event not detected 1
18. 0x06 Ox 1A 0x06 Ox1B 0x06 Ox1C 0x06 Ox 1D The host then must configure the Mailbox application to operate in Legacy mode as shown in the following example Example 7 4 1 MBO 0x18 Sets the APP_ID Mailbox Mode Config application identifier 0x18 2 MBI 0x20 Sets the Command Write Config 0x20 3 MB2 0x00 Sets the Offset to Zero field 0x00 to point to the configuration register 4 MB3 0x01 Sets the Count field to 0x01 because only one data byte needs to be sent 5 MBA 0x10 Sets the DATA value to 0x10 which sets the LEGACY field to 1b or Legacy mode Bytes to send 0x18 0x20 0x00 0x01 0x10 The MMA955xL platform now is set to Legacy mode and the Quick Read registers are being constantly updated with the low passe filtered AFE data MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 75 A EIE EE L121Z1AZZXA A1ZAOOO4A IDIDDDLLLLALLLLLLLAALAUAE AELLLLLLANENESZI Mailbox Application All that remains is the issuing of a command to read the six bytes starting at MB26 which contains the XYZ data in constant read mode In the following example Ox represents the data that is sent back to the host Example 7 5 BOX3 BOX6 MBOXO MBOX1 BOX2 MBOX4 MBOX5 BOX MBOX8 MBOX9 0x04 0x30 Ox1A 0x06 Ox Ox Ox Ox Ox Ox
19. Activity Scheduler parameters for each task this value allows accelerometer activity motion to determine whether 7 6 a task should run High and low activity thresholds are defined with the Sleep Wake application See Sleep Wake Application on page 169 Units None Range of valid values 0x03 ALWAYS execute application during high and low activity 0x02 ACTIVE execute application only during high activity 0x01 INACTIVE execute application only during low activity 0x00 NEVER never execute application priority Scheduler parameters for each task this value determine the priority of the application 5 0 Units None task running at 488 Hz task running at 244 Hz task running at 122 Hz task running at 61 Hz task running at 30 Hz task running at 15 Hz task running at 7 Hz task running at 3 Hz MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 50 Freescale Semiconductor Inc Scheduler Application The variable data for the sched parms registers includes the register name offset and reset Each of the possible application IDs 0x00 0x1F is associated with a scheduler parameter register The following table shows the APP IDs and their associated register offsets and reset values Table 4 10 sched parms registers differentiating values
20. Host communicating to CONFIG_W command Starting at Offset 0 w BOX Application hich is the config for MB4 Number of bytes to write 12 bytes PP_ID_MBOX4 0x06 AF yte_ID_MBOX4 Data X PP_ID_MBOX5 ID MBOX5 Data X D MBOX6 ID MBOX6 Data Y P ID MBOX7 I D T D I UK to ct 0 D U p U p uU p Uu p it Uu UK t H ct 0 yte ID MBOX7 Data Y PP ID MBOX8 yte ID MBOX8 Data Z PP ID MBOX9 Byte ID MBOX9 Data Z MSB LSB MSB LSB MSB LSB E APP ID af 8 Al E af 0x06 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 73 Mailbox Application 7 3 Mailbox status registers There are no status registers for this application 7 4 Reading aggregated data Legacy mode Quick read Once the MBOX application is configured and the device is set to Legacy communication mode the aggregated data can be read Assuming that the MBOX application was set up as show in Section 7 2 2 Configuring XYZ data the X Y and Z acceleration data output will be available in mailboxes 4 through 9 through the normal command response Communications Interface If the host needs to just read the data without the finer control of the command response model the MMA9S55xL can be put into Legacy mode This assigns the desired data to registers in the Quick Re
21. In this example all other Low g configuration register values are at the reset default values The device powers up in Sleep mode but it may become necessary to wake the part That process is done in the following example Example 15 3 1 MBO Set App ID to 0x12 Selects the Power Controller modes 2 MB1 Command to 0x20 Sends a write configuration with offset 0 3 MB2 Set offset to 0x06 4 MB3 Set count field to 0x01 5 MB4A Send the data value 0x00 Bytes to Send 0x12 0x20 0x06 0x01 0x00 The device is enabled and configured to have an event Queue and send Low g events to the Event Queue To cause a Low g that can be measured on the X Y and Z axes toss the board into the air Read the Event Queue applications status register to get the data MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 153 Event Queue Application To set up for reading the status register send the command in the following example Example 15 4 1 MBO Set APP ID to 0x10 Selects the Event Queue application 2 MB1 Command to 0x30 Sends a Read Status space command 3 MB2 Set offset to zero 0x03 Start reading status values at register 0 4 MB3 Set count field to 0x20 Reads 10 bytes 3 status APP ID 6 data Bytes to Send 0x10 0x30 0x03 0x20 The following response is returned 10 80 13 20 09 95 AC 09 OF 00 00 95
22. RCE DOUE PERI i ducis ed oto a a didas ere dedi th oo do d aed 93 Bos Tame CONUM Loos cece sore ete Ipiybae ded dbi dd qe Ed EE RAP 94 Chapter 9 Portrait Landscape Application 9 1 Overview of Portrait Landscape application 2 200 eee eee 95 9 2 Portrait Landscape configuration registers 000 eee ees 98 BII ihreshold daa riri LE BARRERA eR ERR a Babes 98 922 landscape SUME Loo ques east dated e ds wid RE Eid ad en log ecu e eke 98 9 2 3 portrait A 99 DA a COU aa uada ed dex zn dax rdud d pipot enia a aaeeei 99 Boc eirese ED uad cadena eee eked EIE CR CR ICA NC IDE ROI RO Ea QURE 100 9 2 6 hysteresis BAFRO eisque eid ie Kk he er RE ded dom o C er ORCI ele ede 100 Tar BEN Lcexoszas qaxasdedd dd O 101 9 3 Potrtrai Landscape status registers coooocnonrca ddr eb RR cir 102 A MNT Ero PE ror TS 102 9 3 2 Programming example iud cir ee UR ERO EO sy b dE AA 103 Chapter 10 High g Low g Application 10 1 Overview of High g Low g application 00 202 eee ee 105 10 2 High g Low g configuration registers 26 csccesacee uhr ra aaa RARE RR 108 10 2 1 low_g_thresh oou gba des ic who wae aw bbb e ah al anak om eo soe We dee 108 A ONL nbn qt SERIO Ie a o OEE eee soo aoc bie ees 108 IDE IB STE DU AA 109 AA O ie ER nl dot 112 e SMON AAA 112 IDEO A 0 ir E AI 113 10 27 ho event MaSK iu nvadarasci A a docu dear eA IRR Aia RC a ab ex 114 10 3 High g Low g status register 22 aa doceo ook n d DESDE LEE AAA 115 ERA LR REI
23. References on page 13 2 4 2 RAM allocation An application may reserve a portion of the system RAM by calling the system API function RequestDataRam function which has the following format uint8 t RequestDataRam uint16 sz uint8 u8app id The required parameters are the size of the RAM to be reserved and the identifier of the application requesting RAM The function returns the address of the allocated variable Allocated memory is local to the application that requested the memory Memory allocation can only be done once and should be done in the initialization function There is no mechanism to free or return memory If there is not enough memory available a NULL pointer is returned indicating an error For more information on memory allocation see Memory Allocation for User Applications on page 193 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 20 Freescale Semiconductor Inc Introduction 2 5 System initialization Two types of resets are recognized in the system power on reset POR and pin reset reset After a POR the MMA955xL platform s bootloader reads device specific trim codes that were programmed at the factory and other parameters from the flash memory to configure the hardware The bootloader also copies some of this information into working RAM for use by the platform software It is important to power cycle the device after programming the flash so th
24. The host must add three bytes to de count the total bytes to read MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 141 Data FIFO Application Itis extremely important to adhere to these three conditions or the data FIFO could enter into an error state and be unable to pop coherent data To recover the data FIFO reset the flag in the Reset control byte APP ID 0x17 When the command is sent the first four bytes that the MMA955xL device returns correspond to the response of the command The next byte gives the status of the data FIFO application module and the following two bytes represent the timestamp Hence the three byte offset These bytes are part of those requested by the host so it is very important that the user add three bytes to the number of bytes to read The data stored in the data FIFO comes after these seven bytes If the module is storing data at the exact moment that a read is issued by the host the MMA955xL device will return an error condition A2 When this occurs the host must retry reading the data If any other error is returned the host must take the proper action MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 142 Freescale Semiconductor Inc Data FIFO Application 14 4 Data FIFO block diagram Frame counter TimeStamp register 3 3 Watermark level Mode e Stop on overflow FIFO buffe
25. Version Application on page 31 Configures the system applications and the MMA955xL infrastructure to run 0x01 Scheduler at specific sample rates Additionally the identifier reads the number of times each task has been executed 0x02 Reserved Configures the GPIO application to map a specific application output bit to 0x03 GPIO specific GPIO pins For more details see Chapter 6 GPIO Application The GPIO pins are limited to GPIO6 through 9 Configures an internal mailbox table to map which output bytes from specific 0x04 Mailbox application identifiers will be accessible in the Normal mode and the Legacy mode s Quick Read registers mailboxes The application identifier can perform a table reset to reinstall the default values when the MMA955xL resets 0x05 Reserved Configures different parameters of the AFE and reads XYZ data from the 0x06 Analog Front End accelerometer For further details see Chapter 8 Analog Front End Application Configures different parameters of the portrait and landscape application and 0x07 Portrait landscape detection reads and writes data from and to the applications For further details see Chapter 9 Portrait Landscape Application Configures different parameters of the high g application The application 0x08 High g detection identifier reads the output bytes from its output structure For further details see Chapter 10 High g Low g Application Configures
26. application s status register If the user wants to toggle GPIO Pin 8 whenever an orientation change is detected the example shows what a host should send to the MMA955xL device to create this configuration Example 9 1 Connecting the PL application to a GPIO pin MBOXO MBOX1 MBOX2 MBOX3 MBOX4 MBOX5 0x03 0x20 0x04 0x02 0x07 0x07 GPIO Application ID CONFIG W command Starting at Offset 4 for the GPIO 8 registers Number of bytes to write 12 bytes APP ID GPIO8 0x07 for the PL Application SR bitnum GPIO8 0x07 for the 7th bit in the PL Application status which is the PL Event MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 103 Portrait Landscape Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 104 Freescale Semiconductor Inc Chapter 10 High g Low g Application 10 1 This application reads the acceleration values of each axis tests the value for each axis and determines if the value is above the high g threshold or below the low g threshold The application outputs a bit for each axis value detected as low g or high g The application also outputs a bit with the high g flags ORed or ANDed and one bit for the low g flags ORed or ANDed Overview of High g Low g application High g and low g thresholds are configurable by the user Application
27. 0x00 Bit 7 6 5 4 3 2 1 0 Field Evnt Lock LAPO BAFRO Reset 0 0 0 0x00 0x00 Table 9 16 PL_Out bit descriptions Field Description Evnt Reports a PL event 0 No event detected 1 PL change orientation event detected Lock Reports a z tilt angle lockout 0 Lockout condition has not been detected 1 Z tilt lockout trip angle has been exceeded Lockout has been detected LAPO Reports a new portrait landscape orientation event 000 Undefined The default power up state 001 Portrait up Device is standing vertically in the normal orientation 010 Portrait down Device is standing vertically in the inverted orientation 011 Landscape right Device is in the landscape mode to the right 100 Landscape left Device is in the landscape mode to the left BAFRO Reports a new back or front orientation event 00 Undefined This is the default power up state 01 Front Device is in the front facing orientation 10 Back Device is in the back facing orientation MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 102 Freescale Semiconductor Inc 9 3 2 Portrait Landscape Application Programming example The following example shows how the PL application could be connected to a GPIO pin In the code the PL application is APP ID 0x07 and the bit that indicates an orientation changes is bit 7 of the PL
28. 0x08 high ID 0x09 low Default speed 244 Hz Configuration Start on registers page 108 Status Start on registers page 115 The High g Low g application uses the 3 axis data from the accelerometer and transforms it into absolute values These values are used to determine if any of the axes values are above the high g threshold or below the low g threshold For user convenience this application appears at both APP IDs 0x08 and 0x09 The High g and Low g configurations and outputs are all in the same registers at both of the APP IDs The following figure shows the high g low g block diagram High g Low g application Absolute X y 2 Sensor data Decision logic low_g_thresh high_g_thresh low g cnt min high g cnt min Outputs low g x flag low g y flag low g z flag AND OR low g flag high g x flag high g y flag high g_z flag Figure 10 1 High g and low g signal flow diagram MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 e e e e ee ee ee ee ed Freescale Semiconductor Inc 105 High g Low g Application When the signal goes above the high g threshold for the minimum number of times configured in the high g cnt min register the application detects a high g condition for the single axis When the signal goes below the low g threshold for the minimum number of times configured in the low g cnt min register a low g condition is detected for a single ax
29. 0x16 0x17 16 Mailbox 15 APP_ID and Byte ID 0x18 0x19 16 Mailbox 16 APP_ID and Byte ID Configuration 0x1A 0x1B 16 Mailbox 17 APP_ID and Byte ID 0x1C 0x1D 16 Mailbox 18 APP_ID and Byte ID 0x1E 0x1F 16 Mailbox 19 APP_ID and Byte ID 0x20 0x21 16 Mailbox 20 APP_ID and Byte ID 0x22 0x23 16 Mailbox 21 APP_ID and Byte ID 0x24 0x25 16 Mailbox 22 APP_ID and Byte ID 0x26 0x27 16 Mailbox 23 APP_ID and Byte ID 0x28 0x29 16 Mailbox 24 APP_ID and Byte ID 0x2A 0x2B 16 Mailbox 25 APP_ID and Byte ID 0x2C 0x2D 16 Mailbox 26 APP_ID and Byte ID 0x2E 0x2F 16 Mailbox 27 APP_ID and Byte ID 0x30 0x31 16 Mailbox 28 APP_ID and Byte ID 0x32 0x33 16 Mailbox 29 APP_ID and Byte ID 0x34 0x35 16 Mailbox 30 APP_ID and Byte ID 0x36 0x37 16 Mailbox 31 APP_ID and Byte ID 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 25 Introduction Table 2 2 Freescale provided applications registers continued i Address Width bits Register Name Status None Analog Front End AFE application APP ID 0x06 Address Width bits Register Name 0x00 0x01 16 AFE CSR 0x02 0x03 16 User Offset X 0x04 0x05 16 User Offset Y Configuration 0x06 0x07 16 User Offset Z 0x08 8 High Pass Filter Cutoff Coefficient 0x09 8 Low Pass Filter Cutoff Coefficient 0x0A 8 Te
30. 4 3 2 1 0 Field request to start 15 8 request to start 7 0 Reset 0x00 0x00 Table 4 5 request to start description Field Description request to start Indicates which APP IDs are marked for starting at the beginning of the next scheduler interval Each bit 31 0 corresponds to an APP_ID It is important that the user do a read modify write type of access to ensure that the contents of the resister are logically ORed with the new value to avoid erasing the request_to_start bit of the other APP_IDs that are waiting to start Setting the bit will mark the APP_ID for starting in the next scheduler loop Units None Range of valid values 0 to OXFFFFFFF The host controller may issue a command through the slave communications port to trigger the running of an application To do this the host controller does a read modify write to the request_to_start configuration register and sets the appropriate bit associated with the application that the host wants to Start Similarly a user application running natively on the MMA955xL platform can trigger one or more applications to start by writing directly to the request_to_start register Since the scheduler only samples this configuration register through its interrupt handler a trap interrupt is available for user code to invoke the scheduler This mechanism is intended to support user defined MMA955xL I
31. 5 2 MBOX Configuration register Table 19 2 MBOX Configuration register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field INT O EN INT_O_POL INTO LEGACY UPDMODES FRAME EN Reset 0 0 0 0 00 0 0 Table 19 3 Communications configuration register field descriptions Bit s Field Description 7 INT O EN Enables or disables the assertion of the INT O signal every time a mailbox command is been processed Range of valid values O Disables the assertion of the INT O signal 1 Enables the assertion of the INT O signal 6 INT O POL Configures the polarity of the INT O signal when it is asserted Range of valid values 0 Active high 1 Active low 5 INT O FRAME EN If enabled generates the INT O interrupt on completion of the AFE sample once each frame If not enabled the INT O signal is generated on a command complete basis This bit was added to support synchronization between the host and the MMA955xL device Data will be ready on a frame basis 488 Hz 244 Hz or 122 Hz Range of valid values 0 Interrupt not generated 1 Interrupt generated on completion of AFE sample 4 LEGACY Selects between Normal and Legacy mode Range of valid values 0 Normal mode 1 Legacy mode 3 2 UPDMODES When in Legacy mode configures how and when the Quick Read registers are updated This field is valid only if the Mailbox is operating in Legacy mode See Bit 4 Range of valid values 00 Mode 0 Upda
32. AAA 53 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 3 Section Number Title Page Chapter 5 Communication Interface 51 Overview of Communication Interface 1 2 keke sn cee ee cea rmt eh xy RR 55 na MADO Ae criada EO EC Ree 55 5 2 1 Mailbox timing diagrams sss dod ded eoo EROR RR CR eed Roo tini ACIE CR Pee 56 LUE a MPO 56 5 3 1 Mailbox command format for a write llle 57 5 3 2 Application IDs names and descriptions o o o ooooooooooo 58 5 3 3 Mailbox command format TOF a read ouod dado ROR COO RO 60 Chapter 6 GPIO Application 6 1 Overview of GPIO application a iae dede deo o AA EI OR RC edes 63 6 2 GPL configuration registers currar ER dd d md dot AS RR R UR RE e 63 6 21 GPIO register les cute nev sarria dera 64 6 2 2 GPIO polarity configuration cst coe cide due Rare tuc aum RA Sca Re Rer ace 66 6 2 3 GPIO application bit descriptions 4 440444 404 00800 4565 AAA 66 Chapter 7 Mailbox Application 7 1 Overview of Mailbox application i cse edi cstacacedeeeeeeentiwiiawiae fetus 67 2 Mailbox configuration registers fckc dso srta rare de dr ub oe naa e 67 Pul MBOXDBILOSSOEDNOB sidra ii 72 Jas SO XYZ BUR bee dos od ub ac OR AC Je ede od de do won oe abi GA Cae T3 Lo Mailbox status registers cocer RE ke au a a ea ee a cu 74 7 4 Reading aggregated data Legacy mode Quick read o ooooooooo 74 Chapter 8 Analog Front End Applicati
33. BE 09 OF 00 00 95 DO 09 OF 00 00 MBO APP ID 0x10 Event Queue application MB1 STATUS 0x80 Command Complete no errors MB3 Actual Data Count 0x13 10 bytes of data MB2 Requested Data count 0x20 10 bytes of data MB4 0x09 Event Queue Status Watermark and Overflow flags are set MB5 6 0x95AC Timestamp MB7 APP ID of the application providing the actual data 0x09 the AFE application MB8 10 OxOF0000 Ox0F is the status register from the Low g applications OxOF indicates a Low g event on all axes MB5 6 0x95BE Timestamp MB7 APP ID of the application providing the actual data 2 0x09 the AFE application MB8 10 OxOF0000 MB5 6 0x95D0 Timestamp MB7 APP ID of the application providing the actual data 2 0x09 the AFE applications MB8 10 OxOF0000 The offset is fixed to three bytes MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 154 Freescale Semiconductor Inc Event Queue Application When the command is sent the first four bytes that the MMA955xL device returns correspond to the response of the command The next byte is the status from the Event Queue application This fifth byte is part of the bytes requested by the host so it is very important that the user add one byte to the number of bytes to be read Due to the application s read functionality if the application is storing data at the exact moment a read is issued by the host the MMA955xL device will return
34. Frame Counter application APP ID OxOE Address Width bits Register Name Configuration None Address Width bits Register Name Status 0x00 0x01 16 Frame Count Data FIFO application APP ID OxOF Address Width bits Register Name 0x00 8 FIFO CONFIG 0x01 0x03 Not used Configuration 0x04 0x05 16 FIFO SIZE WORD 0x06 8 FIFO Channel APP_ID 0x07 Not used 0x08 0x09 16 Watermark Address Width bits Register Name Sais 0x00 0x01 16 Records Number 0x02 8 Entry Size 0x03 8 FIFO STATUS Event Queue application APP_ID 0x10 Address Width bits Register Name 0x00 0x01 16 Queue Size Configuration 0x02 0x03 16 Queue Watermark 0x04 0x05 16 Queue Timeout Address Width bits Register Name 0x00 0x01 16 Records Number Status 0x02 8 Entry Size 0x03 8 QUEUE STATUS 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 29 Introduction Table 2 2 Freescale provided applications registers continued i Status Register application APP ID 0x11 Address Width bits Register Name 0x00 0x01 16 Status Bit 0 APP ID and SR BIT Configuration 0x02 OxOD 16 Status Bits 1 through 6 APP ID and SR BIT Ox0E 0x0F 16 Status Bit 7 APP_ID and SR BIT Address Width
35. Freescale Semiconductor Inc 19 Introduction These rules enable the scheduler to determine the locations of user applications at runtime execute those applications in the appropriate priority and access the applications configuration and output status registers From the host interface Freescale applications and user applications are configured and read in the same way Both are normal applications and are identified by their APP ID The definition and structure of an application table is shown in the following example Example 2 1 Application table typedef struct app table tag uint32 table identifier magic code to identify app table 0x9550CODE uint32 num of apps number of entries in this app table Data APMap t apmap actual app table table app table t typedef struct Data APMap tag void initCbFn void init callback function pointer void rstCbFn void reset callback function pointer void clrCbFn void clear callback function pointer void applicationMain void Application function pointer uint8 t APP ID uint8 t parameter bytes Number of bytes in the configuration parameters uint8 t output bytes JData APMap t For information on creating your own custom application to run on the MMA955xL platform see User Applications on page 197 and Building Custom Applications on MMA9550L MMA9551L AN4129 To access the application note see
36. IDs register MB3 Set the Count field 0x04 to write four bytes MB4 Set the DATA value to 0x20 This bit is the Ox 19th bit in this 32 bit register 6 MB4 Set the DATA value to 0x00 7 MB4 Set the DATA value to 0x00 8 MB4 Set the DATA value to 0x00 Command to send for write 0x01 0x20 OxOC 0x04 0x20 0x00 0x00 0x00 Qucm par poor MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 49 Scheduler Application 4 6 4 Scheduler parameters register Both the Freescale and user applications have the same structure for their sched parms registers That structure is shown in the following figure For more information on the Activity and Priority bits see Table 4 9 on page 50 Table 4 8 sched parms register structure Range of valid values 0x17 TASK488HZ 0x16 TASK244HZ 0x15 TASK122HZ 0x14 TASK61HZ 0x13 TASK30HZ 0x12 TASK15HZ 0x11 TASK7HZ 0x10 TASK3HZ OxOF PRIORITY15 OxOE PRIORITY14 0x0D PRIORITY13 0x0C PRIORITY12 0x0B PRIORITY11 Ox0A PRIORITY10 PRIORITY9 PRIORITY8 PRIORITY7 PRIORITY6 PRIORITY5 PRIORITY4 PRIORITY3 PRIORITY2 PRIORITY1 PRIORITYO QO mN CO R O O OO Bit 7 6 5 4 3 2 1 0 Field Activity Priority Table 4 9 sched_parms_APP_ID bit descriptions Field Description
37. IRQ Interrupt AppIDs 7 0 Reset 0x00 0x00 Offset 0x10 MSB 0x11 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMOV Interrupt ApplDs 31 24 TPMOV Interrupt_AppIDs 23 16 Reset 0x00 0x00 Offset 0x12 0x13 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMOV Interrupt AppIDs 15 8 TPMOV Interrupt_AppIDs 7 0 Reset 0x00 0x00 Offset 0x14 MSB 0x15 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMCHO Interrupt_AppIDs 31 24 TPMCHO Interrupt AppIDs 23 16 Reset 0x00 0x00 Offset 0x16 0x17 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMCHO Interrupt_AppIDs 15 8 TPMCHO Interrupt_AppIDs 7 0 Reset 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 46 Freescale Semiconductor Inc Scheduler Application Table 4 6 user interrupt registers continued Offset 0x18 MSB 0x19 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMCH1 Interrupt_AppIDs 31 24 TPMCH1 Interrupt_AppIDs 23 16 Reset 0x00 0x00 Offset Ox1A 0x1B LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field TPMCH1 Interrupt_AppIDs 15 8 TPMCH1 Interrupt_AppIDs 7 0 Reset
38. MBOX 7 Byte ID MBOX 7 Reset 0x00 0x00 Offset 0x08 0x09 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 8 Byte ID MBOX 8 Reset 0x00 0x00 Offset Ox0A 0x0B Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP_ID MBOX_9 Byte_ID MBOX_9 Reset 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 68 Freescale Semiconductor Inc Mailbox Application Table 7 1 MBOX registers continued Offset 0x0C 0x0D Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 10 Byte ID MBOX 10 Reset 0x00 0x00 Offset OxOE OxOF Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 11 Byte ID MBOX 11 Reset 0x00 0x00 Offset 0x10 0x11 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 12 Byte ID MBOX 12 Reset 0x00 0x00 Offset 0x12 0x13 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 13 Byte ID MBOX 13 Reset 0x00 0x00 Offset 0x14 0x15 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 14 Byte ID MBOX 14 Reset 0x00 0x00 Offset 0x16 0x17 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
39. MSB 0x07 LSB et lt 2 Wee see Trae Belem Aa lee XE EEEE Field user_offset Z user_offset Z Reset OxFF OxFF Table 8 8 user offset XYZ bit descriptions Field Description user offset XYZ Sets user offsets in the X Y and Z axes for the accelerometer depending on the position on the device in the user board These values are considered as post mount offsets Units 0 244 mg LSB Range of valid values 32 768 to 32 767 Reset value OxFF which is interpreted as 1 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 84 Freescale Semiconductor Inc 8 2 3 This register s bits are shown in the following table config k Table 8 9 config k registers Analog Front End Application Range of valid values 0 to 15 Offset 0x08 0x09 Bit 6 5 4 3 2 0 7 6 5 4 3 2 1 0 Field config K HIGHPASS config K LOWPASS Reset 0x00 0x00 Offset Ox0A 0x0B Bit 6 5 4 3 2 0 7 6 5 4 3 2 1 0 Field config_k TEMP_LPF config_k EIC_LPF Reset 0x00 0x00 Table 8 10 config_k bit descriptions Field Description config_k High pass filter configurable cutoff HIGHPASS Units None Range of valid values 0 to 15 config_k Low pass filter configurable cutoff LOWPASS _ Units None
40. Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 165 Status Register Application 16 2 16 Output Bit ID SR 07 Table 16 16 Output Bit ID SR 07 register Offset OxOF Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR 07 Reset 0x00 Table 16 17 Status Register bit descriptions Field Description APP ID APP ID SR n 7 0 The application identifier Zero value and OxFF are reserved Units None Range of valid values 0 to 31 and OxFF realistically up to Ox1F Bit ID Output Bit ID SR n 7 0 The bit number to be mapped on the Status Register bit n Units Non dimensional Range of valid values 0 to 255 COMMENT 32 data registers x8 bits each 256 possibilities selection is similar to as GPIO Application give an practical example as well probably similar to the GPIO application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 166 Freescale Semiconductor Inc Status Register Application 16 3 Status Register default configuration After reset the status register configuration registers contains the Portrait LAPO BAFRO and Z Tilt lockout bits as well as the Data Ready and Command Complete bits NOTE The upper two bits in the upper byte are fixed but the lower eight bits in the lower byte can be remapped by the user to any application and bits Table 16 18 Status Reg
41. Range of valid values 0 to 15 config_k Low pass filter configurable cutoff for temperature sensor output TEMP LPF Units None Range of valid values 0 to 15 config_k Low pass filter configurable cutoff for external input conversion output EIC LPF Units None MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 85 Analog Front End Application 8 2 4 sfd rate This register s bits are shown in the following table The system defaults to 488 Hz so this document assumes that is the rate being run If the user slows down the rate by changing the sfd rate register all references to 488 Hz or the system frame rate will scale accordingly Table 8 11 sfd rate register Offset 0x0C Bit 7 6 5 4 3 2 1 0 Field sfd rate Reset 0 0 0 0 0 1 1 1 Table 8 12 sfd rate bit description Field Description sfd rate Defines the system frame interval the time period for each sample or the system sample rate in Hz Units None Range of valid values 7 to 14 Table 8 12 shows the relation between the register value and the interval between each frame Table 8 13 Frame interval according to the sfd rate value sfd rate value Time frame s Max frames per second 7 2 05E 3 488 28 8 4 10E 3 244 17 9 8 19E 3 122 07 10 1 64E 2 61 04 11 3 28E 2 30 52 12 6 55E 2 15 26 13 1 31E
42. Semiconductor Inc High g Low g Application MB2 RequestedData count 0x01 MB3 Actual Data Count 0x01 MBA Data 0x03 Only X and Y are showing a Low g event At this point the evaluation board was tossed up so that it would go through a 0g event Request the status data by sending the following command to set up for reading the status register Example 10 3 1 MBO 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 Read the mailboxes The expected response to these commands is 09 80 01 01 OF MBO APP ID 0x09 MB1 STATUS 0x80 Command Complete no errors MB2 RequestedData count 0x01 MB3 Actual Data Count 0x01 MB4 Data OxOF All axes X Y and Z and or flags are set MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 111 High g Low g Application 10 2 4 high g thresh Table 10 7 high g thresh registers Offset 0x04 MSB 0x05 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field high_g_thresh high_g_thresh Rest c5 gi Deas orate il Se ae e rastro De coo aps 6 Tab
43. User Application variables La Set priority and activity of UserApplicationl Second user image i Initilize User Application variables Third user image void resetCbFunction void void clearCbFunction void void UserApplicationl void Figure 2 3 Flash memory map Application table The MMA955xL platform supports user applications that are contained in up to three additional application tables These additional applications must follow these rules Valid application tables are located at the 512 byte flash memory page boundaries The 32 bit addresses for functions and data within this map can refer to any absolute flash memory or RAM location For more information see RAM allocation The embedded ColdFire processor s register A5 cannot be read nor modified Each user application must have a unique application identifier APP_ID The user must not use any of the Freescale application identifiers For a list of these identifiers see Table 2 1 on page 22 For all static RAM variables the memory allocation API function should be used All RAM allocation must be included in the initialization callback function The initialization callback function provides a way to execute some initialization code before any application is run For further information see Memory Allocation for User Applications on page 193 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0
44. bit is set Alternatively the MMA955xL platform can be configured to assert an interrupt signal at the completion of a command If configured the INT O interrupt will be set immediately after the COCO bit has been set For more information see Configuring mailbox operational mode on page 191 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 56 Freescale Semiconductor Inc Communication Interface 5 3 1 Mailbox command format for a write Commands written to the MMA955xL platform are sent in the format shown in the following table Mailboxes are filled with data depending on the target application All commands start with the APP ID the command the destination offset and the number of data bytes to write All commands must be written in a single I C SPI transaction starting at Mailbox 0 but the response can be read from any subset of the mailbox registers For a write request command the first four mailboxes must be written with enough bytes to hold the requested number of bytes The format of the data bytes is specific to the targeted application Applications are described in Table 5 3 Table 5 1 Mailbox commands formats Offset 7 6 5 4 3 2 1 0 0x00 Application ID APP_ID 0x01 0 Command Byte offset upper 4 bits 0x02 Byte offset lower 8 bits 0x03 Requested number of bytes to read write 0x04 Write data 0 0x05 Write data 1 0x06 Write d
45. bits Register Name Status 0x00 0x01 16 Status Register Sleep Wake application APP_ID 0x12 Address Width bits Register Name 0x00 0x01 16 Sensitivity threshold 0x02 0x03 16 Doze Time Threshold Configuration 0x04 8 Long Time Off 0x05 8 Short Time Off 0x06 8 Config Address Width bits Register Name Status 0x00 8 Scheduler Mode Reset Suspend Clear application APP ID z 0x17 Status Address Width bits Register Name 0x00 0x03 32 Reset Control Bits Configuration 0x04 0x07 32 Suspend Control Bits 0x08 0x0B 32 Clear Control Bits Address Width bits Register Name None 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 30 Freescale Semiconductor Inc Chapter 3 Version Application The MMA955xL device s system version information is stored in a 12 byte pplication 0x00 packet and contains system identity information including device hardware p ID the versions of the ROM bootloader primary firmware and hardware and the system build information Default speed Prays available The following table describes the system version packet and its i corresponding mailbox alignment Configuration ee Sp 8 8 registers Table 3 1 Version command description bytes Status None regist
46. data and appends the timestamp to the data If the host requests N bytes and that is bigger than the entry size the pop routine will append the timestamp only for the first entry that fits in the N bytes requested The host must calculate the timestamps for the extra entries requested within the N bytes The host can request to read up to 255 bytes at a time Assuming the AFE is providing data this is exactly 36 packets of AFE data Each host FIFO read transaction includes a status byte and a timestamp word These three bytes are prefixed to the payload data Payload data is prefixed with the APP ID of the application that has provided the data In the AFE case the APP ID is 0x06 255 3 status and timestamp 7 APP ID 6 byte XYZ data 36 Reading the FIFO example The device powers up in Sleep mode but it may become necessary to wake the MMA955xL device Waking the device uses the following mailboxes MBO 0x12 App ID 0x12 Power Controller modes MB1 0x20 Command 0x2 Write configuration Offset 0 MB2 0x06 Offset 2 0x06 MB3 0x01 Count of data to write MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 138 Freescale Semiconductor Inc MBA 0x00 Actual Data Value Clears sleep bit Bytes to Send 0x12 0x20 0x06 0x01 0x00 Example 14 1 Data FIFO Application To configure for FIFO operation write the following transaction to the Data FIFO application l Qe ue 11
47. enables the low power mode If this bit is set the device doesn t execute the STOP assembler instruction even if the SNCEN FLEEN or SCHEN bits are set as 1b 0 Enables STOP mode 1 Disables STOP mode IRQ EN Enables or disables the IRQ interruption in the GPIO 4 0 Disables IRQ interruption 1 Enables IRQ interruption SCHEN Enables or disables the Doze mode 0 Disables the Doze mode 1 Enables the Doze mode FLEEN Controls the use of long and short time between AFE samples when in Doze mode If this bit is cleared the application does not use the long and short time values to determine the time between AFE samples Instead the time is fixed as 2 05 ms 0 Time between AFE samples fixed at 2 05 ms 1 Long and short time values determine the time between AFE samples SNCEN Enables or disables the Sleep mode Note When this bit is set the device will enter Sleep mode The device can only exit this mode is by clearing this bit via a configuration write command 0 Disables the Sleep mode 1 Enables the Sleep mode MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 175 Sleep Wake Application 17 3 Sleep Wake status registers 17 3 1 scheduler mode Table 17 11 scheduler mode register Offset 0x00 Bit 7 6 5 2 1 0 Field scheduler_mode Reset 0 0 0 0 0 0 Table 17 12 scheduler_mod
48. in the initialization function or the sensor will start in Sleep mode and never run the user applications The following example shows how to overwrite the default configuration of the cfg register Example 17 1 void initCbFunction void power control structure pointer power_data_struct_t sleep_ptr Assign power control structure address to pointer Sleep ptr GetDataPtr LONG SHORT INT APP ID configure power ctrl module to be in run mode sleep ptr param pco cfg 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 171 Sleep Wake Application 17 2 Sleep Wake configuration registers The following sections give the configuration registers for the Sleep Wake application 17 2 1 sensitivity thresh Table 17 1 sensitivity thresh registers Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field sensitivity_thresh sensitivity_thresh Reset 0x00 1 0 1 0 0 0 0 0 Table 17 2 sensitivity_thresh bit description Field Description sensitivity_thresh Configures the movement threshold of the application to change from Doze to Run mode Units Non dimensional Range of valid values 120 to 300 17 2 2 doze time thresh Table 17 3 doze time thresh registers Offset 0x02 MSB 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1
49. mode the FIFO stores data until an overflow condition is reached At an overflow the overflow flag is set MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 137 Data FIFO Application The host asynchronously reads payload packets from the Data FIFO application Reading payload packets frees up slots for new entries into the FIFO If the host reads data faster than the applications put data into the FIFO the overflow condition will never happen The overflow condition occurs when the available buffer memory is full and there is no space available for another packet 14 2 2 Free run The FIFO behaves as a circular buffer that stores data from the configured channel every single frame as long as the FIFO is enabled In this mode the FIFO never stops storing data even though the overflow condition is reached and the overflow flag is set When the FIFO becomes full the oldest data in the buffer will be overwritten first 14 3 Reading process To read the data FIFO the host sends a read data command to the MMA955xL device that calls the Data FIFO application stores the requested data within the FIFO into a buffer and returns the number of bytes read The data FIFO does not tag each entry with a timestamp only storing a timestamp for the last entry When the reading process is performed the Data FIFO application calculates the timestamp for the first group of requested
50. needs to start again 4 7 1 Timeouts A timeout condition indicates that the scheduler has been somehow compromised by a user application Table 4 11 Scheduler status register Offset 0x00 MSB 0x01 acacia iaa rer seed eae ll ESI e qug Field timeout status 31 24 timeout status 23 16 Reset 0x00 0x00 Offset 0x02 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field timeout status 16 8 timeout status 7 0 Reset 0x00 0x00 Table 4 12 sched_parms_APP_ID bit descriptions Field Description timeout status Indicates the priority level of the task that has timed out one or more times 31 0 The register sets the corresponding priority level bit when a task is timed out currently running and being marked request to start This bit must be monitored to verify that no user task is compromising the scheduler execution Units None Range of valid values 0 to OXFFFFFFFF MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 53 e Scheduler Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 54 Freescale Semiconductor Inc Chapter 5 Communication Interface 5 1 Overview of Communication Interface All access to the MMA955xL platform is made via the slave serial Communica
51. no records or entries having been stored Units Non dimensional Range of valid values 0 to 1 wmrk_flag Indicates when the numbers of bytes within the Event Queue have reached the watermark Units Non dimensional Range of valid values 0 to 1 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 159 Event Queue Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 160 Freescale Semiconductor Inc Chapter 16 Status Register Application 16 1 The Status Register Application provides a simple way for users to combine specific status information bits from multiple applications and read that combined information from one place Overview of Status Register application The Status Register Application configures the output of its status register by mapping a specific status register bit to a specific output bit of a specific application This enables the Status Register Application to provide a combined status from the selected bits of user specified applications cpu 0x11 Default speed 488 Hz Configuration Start on registers page 162 Status Start on registers page 167 There are eight user configurable bits in the Status Register Each bit mirrors an output bit in the related application The following example maps some of the output bits of the Portrait Landscape Application P L to
52. operatio a a idee ix d ora xd Rat od de ee ends d ma d x Ad E ede 152 INIHI BIO oi eh oer eds HEE OSE dO RR CEDERE AR Fd ple e RR EN 152 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 6 Freescale Semiconductor Inc Section Number Title Page 35 1 3 Event Queue Block diagram oe oe cs uk dw ddr ERR rien xA ROW RR Ree 155 15 2 Event Queue configuration registers 4 44 cccdcscade RRRRRRXECEROE RR RE EY RRRRE 156 p AE D NW WP PRIMER NATUR 156 Ia QUEUE SN ais bab ali ioo Cle edo od dc d odo ede ee doo apa d 156 158300905 WING Lauda cade cede cor coca ee be beta dedicare dedu 157 15 3 Event Queue status registers oc ecie ccc cad nans ee nx a ES RR Ea Ra 158 15 3 1 records number iisse spese chm pex Rn som dep RR E n 158 jo D QM Sur Ke ER RE de HAE be eke eT eee Ree 158 Wier OBOE SAUS 5 ck kee REN ORO aee dede do OR AAA 159 Chapter 16 Status Register Application 16 1 Overview of Status Register application 00 00 eee ee 161 16 2 Status Register configuration registers aasa cc ees 162 ge eA T APP UD TIE ee eee ne er dole deor er eer eee rere E er ee 162 16 2 2 Qutput Bt ID SEI DU ies ok vw Mora RARA AN A AES RR den 162 IG ESAME ID SR US rapera ib 2222 25 40 4 441 AB dU 162 16 24 Mipu BE IO DM Ul isbaap esetherqrcdespbebedudadieepaesdemd eis 163 TOP EA RII NI PEPERIT sb aa 163 16 2 6 OU Bi NIE DE adas Box dodo ee ERE e 163 Te ee i ando deodobaban dede ROC IO 163 16 28 Cupu Bi I
53. pins can be set to be active high or active low The default or start up condition of the GPIO pins are unassigned The GPIO pins that are controlled by the MMA955xL platform are described in the following table Table 6 1 GPIO pin names numbers and functions Name Pin number GPIO6 12 GPIO7 13 GPIO8 15 GPIO9 2 6 2 GPIO configuration registers The GPIO application s configurations registers consist of 10 eight bit registers This includes two registers for each of the four GPIO pins and two registers for setting the polarity of the GPIO pin Each GPIO pin is assigned to an APP ID and as an output bit from the assigned application The following table gives the bit descriptions for the GPIO application s registers The application s registers are shown in Table 6 3 through Table 6 11 on page 65 The bit descriptions are given in Table 6 13 on page 66 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 63 GPIO Application 6 2 1 GPIO register tables Table 6 2 APP ID GPIO6 register Offset 0x00 Bit 4 3 Field APP ID GPIO6 Reset OxFF Table 6 3 SR bitnum GPIO6 register Offset 0x01 Bit 4 3 Field SR bitnum GPIO6 Reset 0x00 Table 6 4 APP ID GPIO7 register Offset 0x02 Bit 4 3 Field AP
54. provided applications is given in the following table For details on the specific register and status information see the individual applications chapters The Configuration registers hold parameters to configure and set up the applications The Status registers show the output bits or data from an application Table 2 2 Freescale provided applications registers 4 Scheduler application APP_ID 0x01 Address Width bits Register Name 0x00 0x03 32 Request_to_start 0x04 0x07 32 SFD Interrupt_AppIDs 0x08 0x0B 32 AFE COCO Interrupt_AppIDs 0x0C 0x0F 32 IRQ Interrupt_AppIDs 0x10 0x13 32 TPMOV Interrupt_AppIDs 0x14 0x17 32 TPMCHO Interrupt ApplDs Configuration 0x18 0x1B 32 TPMCH1 Interrupt_AppIDs 0x1C 0x1F 32 MTIMOV Interrupt_AppIDs 0x20 0x23 32 PDBA Interrupt_AppIDs 0x24 0x27 32 PDBB Interrupt_AppIDs 0x28 0x2B 32 Master 12C Interrupt_AppIDs 0x2C 8 sched_parms_APP_ID_0x00 0x2D 0x4A 8 each sched parms APP ID Ox01 through 0x1E 1 0x4B 8 sched_parms_APP_ID_0x1F Address Width bits Register Name Status 0x00 0x03 32 Timeout Status Communications application APP_ID 0x02 Address Width bits Register Name Configuration 0x00 8 Config Address Width bits Register Name Status None 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0
55. the Status Register The example uses the P L application ID 0x07 and maps the following bits e P L output bit 0 to Status Register bit 0 e P L output bit 1 to Status register bit 1 The two P L bit are the back front orientation bits Example 16 1 MBI Set the Command Write Config 0x20 MB4 Set the DATA 0x07 Portrait Landscape application ID D 8v Uc Ron NS MB6 Set the DATA 0x07 Portrait Landscape application ID MBO Set the APP ID Status Register Application 0x11 application identifier MB2 Set the Offset to 0x00 to point to the start of the configuration register MB3 Set the Count field to 0x04 to indicate four bytes of data will follow MBS Set the DATA 0x00 Portrait Landscape application status bit 0 8 MBT Set the DATA 0x00 Portrait Landscape application status bit 1 Bytes to Send 0x11 0x20 0x00 0x04 0x07 0x00 0x07 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 161 Status Register Application 16 2 Status Register configuration registers The following tables show the configuration registers for the Status Register Application The bit descriptions are given in Table 16 17 on page 166 16 2 1 APP ID SR 00 Table 16 1 APP ID SR 00 register Offset 0x00 Bit 4 3 Field APP ID SR 00 Reset 0x07 16 2 2 Output_Bit_ID SR_00 Table 16 2 Outp
56. the Event Queue application Example 15 1 1 MBO Set APP_ID to 0x10 Selects the Data FIFO application 2 MBI 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 0x06 Sends nine bytes 5 MBA Send Data 0x00 Sets Queue size 6 MBS Send Data 0x50 7 MB6 Send Data 0x00 Watermark 8 MB7 Send Data 0x05 9 MBS Send Data 0x00 Timeout 10 MB6 Send Data 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 152 Freescale Semiconductor Inc Event Queue Application Bytes to Send 0x10 0x20 0x00 0x06 0x00 0x50 0x00 0x05 0x00 0x00 The configuration registers can only be written once If the Event Queue must be re configured the device must be reset and the configuration re written Some data now must be sent to the event queue In this example the Low g application is configured to send an event Example 15 2 1 MBO Set APP ID to 0x09 Specifies the Low g application 2 MB1 Command to 0x20 Sends a Write Configuration space command 3 MB2 Set offset to zero 0x09 Start writing configuration values at Register 9 5 MB3 Set count field to 0x01 Sends nine bytes 6 MB4 Send Data 0x08 Event Mask Register Enables Low g events Bytes to Send 0x09 0x20 0x09 0x01 0x08
57. thresh 0x02 8 Low g cnt min 0x03 8 Low g config Configuration 0x04 0x05 16 HI g thresh 0x06 8 HI g cnt min 0x07 8 HI g config 0x09 8 Lhg event mask Address Width bits Register Name Status 0x00 8 Lhg out 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 27 Introduction Table 2 2 Freescale provided applications registers continued i Tap Detection application APP ID 0x0A Address Width bits Register Name 0x00 0x01 16 tap thresh 0x02 8 Tap on min 0x03 8 Tap on max Configuration 0x04 8 TapTap MinTime 0x05 8 Tap K HP 0x06 8 Tap K LP 0x07 8 Tap Axis enable 0x08 8 Tap events mask Address Width bits Register Name Status 0x00 Tap Out 0x01 8 Double Tap Out Tilt application APP ID 0x0B Address Width bits Register Name Configuration kis TRK LP 0x01 8 Tilt Confg 1 0x02 Tilt Event Mask Address Width bits Register Name 0x00 8 Tilt Delta xz angle Status 0x01 8 Tilt Delta yz angle 0x02 8 Tilt Delta xy angle 0x02 8 Tilt z xyz quad 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 28 Freescale Semiconductor Inc Table 2 2 Freescale provided applications registers continued i Introduction
58. uint8 min boundary param struct user filter private tag buffer t buffer USER FILTER AXES private user filter struct t MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 194 Freescale Semiconductor Inc Memory Allocation for User Applications 20 2 API functions The Freescale platform firmware provides two API functions for user applications to request and reserve RAM memory uint8_t RequestDataRam uint16_t sz uint8_t u8appid Description This function reserves the size of memory passed as a parameter starting from the last RAM address used The application data start address that is reserved is registered into the global application data that is used by the communication interface to configure the parameter and read output structures Parameters e u8Size Number of memory bytes to reserve by the function e uint8 tu8appid The identifier of the application with valid values 0 to 31 The identifier value cannot duplicate values used by the firmware applications Return void Pointer to the start address of the reserved memory If not enough memory is available NULL is returned void GetDataPtr uint8_t u8appid Description This function returns the pointer to the application data structure address The function must be called when a user application must access data variables that were not assigned at compilation time Param
59. under its patent rights nor the rights of others Freescale sells products pursuant to standard terms and conditions of sale which can be found at the following address http www reg net v2 webservices Freescale Docs TermsandConditions htm Freescale the Freescale logo CodeWarrior ColdFire Energy Efficient Solutions logo are trademarks of Freescale Semiconductor Inc Reg U S Pat amp Tm Off ColdFire and Xtrinsic are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners O 2012 Freescale Semiconductor Inc All rights reserved freescale K Contents Chapter 1 About This Document A earuosu i dusadd d doc dicii dated d a d eu RD do Dod ado adu ui d D dr addi Ural d 9 L1 PUDO posparto ce tipid Red arbe ne ELPL da 9 Pelee SUMMER iila ERR ee Rese Ae side Oe Pared iaa dE T wed ea deu 9 La S and SOEUR uso ERE S REC adio bald deo oC o Cc one RIF OR dede 9 DEEST 1o AA II 11 1 4 Register figure conventions aed aa 48 EX CI dele dr ee REOR ARANA 12 1 5 References Arm 13 Chapter 2 Introduction Ei PUES BOUE Lus erias kekki Ro EORR dee de o ROCK RARIOR de 15 2 2 MMA955xL package axis orientation 0 20 eee ee 16 29 s AAA 17 24A LS appicalons 2 nisi aS dkms pepinos Made dua B E d ed doe sea did d RO ded a 18 24 1 Applicaton IO 1ada45o oe pirita EE RA E Vues pei Lade ddp sd 19 24 2 RAM allocation 5 qaaa qo ded den Rh sorde OPER
60. 0 Field doze_thresh doze_thresh Reset 0 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 Table 17 4 doze_time_thresh bit description Field Description doze_thresh Configures the time that the device must be still before entering Doze mode For example if the system sample rate if 488 Hz then to set a time of 1 second write 488 0x1EB to this register Units Algorithm cycles Time Algorithm cycles 1 5Rpwncrni I Range of valid values 1 to 65 535 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 172 Freescale Semiconductor Inc Sleep Wake Application 17 2 3 long time off Table 17 5 long time off registers Offset 0x04 Bit 7 6 5 4 3 2 1 0 Field Reserved long time off 3 0 Reset 0x00 0 1 1 1 Table 17 6 long time off bit description Field Description Reserved Bit field reserved long time off Configures the long time interval between AFE samples when the application is in Doze mode Units Time For more information see Section 10 3 High g Low g status register on page 115 Range of valid values from 0 to 10 Long time valuesTime seconds CE eras PEPPER EDOCTUS 4 1 ms uu Pr 8 19 ms Oia a is 16 4 ms cr 32 ms e he liiaudw EVA ES 65 5 ms sr Dr aane E a Ros a ort dus D 131 ms Dlcouvasce exa a aces 162 ms ORE PEDE 524 ms Bis nar ed do
61. 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 51 Scheduler Application Table 4 10 sched parms registers differentiating values continued Register Resets Offset Name Application Bits 7 6 Bits 5 0 0x45 sched parms APP ID Ox19 User application 0x00 0x00 0x46 sched parms APP ID Ox1A User application 0x00 0x00 0x47 sched_parms_APP_ID_0x1B User application 0x00 0x00 0x48 sched_parms_APP_ID_0x1C User application 0x00 0x00 0x49 sched_parms_APP_ID_0x1D User application 0x00 0x00 0x4A sched parms APP ID Ox1E User application 0x00 0x00 0x4B sched parms APP ID Ox1F User application 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 52 Freescale Semiconductor Inc Scheduler Application 4 7 Scheduler status registers The scheduler applications contain a set of output or status registers Status registers can be read by a host processor through the PC SPI slave port read data commands or by internal applications through direct reads The scheduler status is a 32 bit register that gives the priority levels for applications that have timed out Applications time out when their priority level is the one that is currently running and they have been marked with request_to_start Such an application has not finished running before it
62. 0x00 0x00 Offset 0x1C MSB 0x1D Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field MTIMOV Interrupt_AppIDs 31 24 MTIMOV Interrupt_AppIDs 23 16 Reset 0x00 0x00 Offset Ox1E Ox1F LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field MTIMOV Interrupt ApplDs MTIMOV Interrupt_AppIDs 7 0 Reset 0x00 15 8 0x00 Offset 0x20 MSB 0x21 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field PDBA Interrupt_AppIDs 31 24 PDBA Interrupt_AppIDs 23 16 Reset 0x00 0x00 Offset 0x22 Ox23LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field PDBA Interrupt AppIDs 15 8 PDBA Interrupt AppIDs 7 0 Reset 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 47 Scheduler Application Table 4 6 user interrupt registers continued Offset 0x24 MSB 0x25 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field PDBB Interrupt_AppIDs 31 24 PDBB Interrupt ApplDs 23 16 Reset 0x00 0x00 Offset 0x26 0x27 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field PDBB Interrupt AppIDs 15 8 PDBB Interrupt AppIDs 7 0 Reset 0x00 0x00 Offset 0x28 MSB 0x29 Bit 7 6
63. 1 7 63 14 2 62E 1 3 81 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 86 Freescale Semiconductor Inc Analog Front End Application 8 3 AFE status registers 8 3 1 output FRONTEND Stage O XYZ These registers bits are shown in the following table Table 8 14 output FRONTEND Stage O XYZ registers Offset 0x00 MSB 0x01 LSB EE RE Bea lia ee oe S FS d 0 Field output FRONTEND Stage OJ X output FRONTEND Stage OJ X Reset 0x00 0x00 Offset 0x02 MSB 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND Stage OJ Y output FRONTEND Stage OJ Y Reset 0x00 0x00 Offset 0x04 MSB 0x05 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_0 Z output FRONTEND Stage O Z Reset 0x00 0x00 Table 8 15 output FRONTEND Stage 0O XYZ bit description Field Description output Normalized accelerometer data sampled at the default rate of 488 Hz with a 100 Hz FRONTEND Stage 0 bandwidth XYZ Units 0 244 mg LSB Range of valid values 32 768 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 87 Analog Front End Application 8 3 2 output FRONTEND Stage 1 XYZ T
64. 10 9 8 Field Data FIFO Frame User User Tilt Sensing Tap Detect LG HG Counter Application Application Reset 1 1 1 1 1 1 1 1 Offset LSB 0x07 reset bits 7 0 Bit 7 6 5 4 3 2 1 0 Field PL AFE Reserved MBOX GPIO Cl Scheduler General Rst Reset 1 1 1 1 1 1 1 1 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 181 Reset Suspend Clear Control Application Table 18 4 Suspend bit descriptions Field Description Reserved 31 30 Not used User application These are bits to use to reset user applications assigned to the following APP IDs 29 24 Ox1D 0x1C Ox1B Ox1A 0x19 and 0x18 0 Normal Operation 1 Initiates the reset sequence if the user application Reset Suspend Clear 0 Normal operation 23 1 Initiates the reset sequence of the Reset Suspend Clear application User application 22 19 These are bits to use to reset user applications assigned to APP IDs 0x16 0x15 0x14 and 0x13 0 Normal Operation 1 Initiates the reset sequence if the user application Auto Wake Sleep 18 0 Disables the reset sequence of the Auto Wake Sleep application 1 Initiates the reset sequence of the Auto Wake Sleep application Reserved Not used 17 Event FIFO 0 Disables the reset sequence of the Event Queue application 16 1 Initiates the reset sequence of the Event Queue applicatio
65. 14 MSB 0x15 LSB Bit 7 6 5 4 3 2 1 0 6 5 4 3 2 1 0 Field output FRONTEND Stage 0 GMJ Y output FRONTEND Stage 0 GMI Y Reset 0x00 0x00 Offset 0x16 MSB 0x17 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field outputiFrFRONTEND_Stage_0_GMI Z output FRONTEND Stage 0 GM J Z Reset 0x00 0x00 Table 8 21 output FRONTEND Stage 0 GM XYZ bit description Field Description output Raw accelerometer data sampled at the default rate of 488 Hz with a 100 Hz bandwidth The FRONTEND Stage 0 GM resolution depends on the g mode setting configured by afe csr fs XYZ Units 2g mode 0 061 mg L SB 4g mode 122 mg LSB 8g mode 0 244 mg LSB Range of valid values 2g Mode 0 061mg LSB 32768 to 32767 4g Mode 0 122mg LSB 8192 to 8192 8g Mode 0 244mg LSB 4096 to 4096 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 90 Freescale Semiconductor Inc Analog Front End Application 8 3 5 output FRONTEND Stage 0 LPF XYZ These registers bits are shown in the following table Table 8 22 output FRONTEND Stage 0 LPF XYZ registers Offset 0x18 MSB 0x19 LSB et lo ee lias oss pos d elf see ee Swe E 0 Field output FRONTEND Stage_0_LPF X output FRONTEND Stage 0 LPF X Reset 0x00 0x00 Offset 0x1A MSB Ox1B LSB Biti 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
66. 32K 16K 4g 32K 8K 8g 32K 4K The filtered data is shifted according to the g mode to normalize the resolution to the 8 g range The normalized data allows for common handling of the data in the other applications Data is normalized so that 1 g force acceleration shows output of 0x1000 counts or 4096 decimal counts MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 79 Analog Front End Application 8 1 6 Down sampling and stage 1 anti aliasing filter The output of the normalizer is down sampled by two to generate data sampled at 244 Hz The previous sixth order Chebyshev filter is applied to down sampled 244 Hz data to create a 50 Hz bandwidth data stream Table 8 13 provides more details about the varying of the bandwidth depending of the sample rate of the front end application 8 1 7 Absolute value The absolute value of the sensor output is computed 8 1 8 Configurable low pass and high pass filters First order low pass and high pass filters with separate configurable cutoff frequencies at 3 dB are provided 2 K 1 z71 1 0 D71 Hipp z Eqn 8 1 Hypr Z Eqn 8 2 Configurable Lowpass Filter Magnitude dB Magnitude dB 25 1 50 100 150 200 Frequency Hz Frequency Hz Figure 8 3 Frequency response of configurable high and lo
67. 4 3 2 1 0 Field QUADFLAG UNUSED XZ_QUAD YZ_QUAD XY_QUAD Reset 0 0 0x00 0x00 0x00 Table 12 15 tilt_xz_yz_quad bit descriptions Field Description QUADFLAG Records when a change in quadrant is detected Units Flag Range of valid values 0 No change detected 1 Change detected XZ QUAD Stores the quadrant change detected between X and Z axes 5 4 Units Quadrant number Range of valid values 00 Quadrant 1 01 Quadrant 2 10 Quadrant 3 11 Quadrant 4 YZ QUAD Stores the quadrant detected between Y and Z axes 3 2 Units Quadrant number Range of valid values 00 Quadrant 1 01 Quadrant 2 10 Quadrant 3 11 Quadrant 4 XY QUAD Stores the quadrant change detected between the X and Y axes This information is disabled by default 1 0 Units Quadrant number Range of valid values Always reads zero MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 134 Freescale Semiconductor Inc Chapter 13 Frame Counter Application 13 1 Overview of Frame Counter application epum OxOE The Frame Counter application reports the number of frames that have been Default speed 488 Hz processed at the application s execution rate The application counts frames not time It is not real time because the nu None device can
68. 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field MASTER IC Interrupt_AppIDs 31 24 MASTER IC Interrupt AppIDs 23 16 Reset 0x00 0x00 Offset 0x2A Ox2B LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field MASTER IIC Interrupt AppIDs 15 8 MASTER IC Interrupt AppIDs 7 0 Reset 0x00 0x00 Table 4 7 user interrupt bit descriptions Field Description 81 0 Interrupt AppIDs Bit vector indicating which tasks are to start after the interrupt Each bit corresponds to a task and the bit position indicates the task s priority This 32 bit parameter should match the priority of the task that is executing when the interrupt occurs Units None Range of valid values 0 to OXFFFFFF MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 48 Freescale Semiconductor Inc Scheduler Application 4 6 3 1 Interrupt App IDs register configuration example In this example the user has an external interrupt source that wants to run a user application assigned to APP ID 0x19 This requires setting the 0x19 bit position in the IRQ interrupt APP IDs register at offset OxOC OxOF Example 4 4 MBO Set the Scheduler application identifier 0x01 MBI Set the Command Write Config application identifier 0x20 MB2 Set the Offset to Zero field OxOC to point to the IRQ interrupt APP
69. 88 100 LPF To quickly read this data the Quick Read mailbox registers would have to be configured so that they are populated with the low passed filtered XYZ data The following example shows how a host would direct the MMA955xL device to set up quick read mailboxes to contain the following FRONTEND 488 100 LPG XYZ data MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 74 Freescale Semiconductor Inc Mailbox Application e Data X to mailboxes 26 and 27 e Data Y to mailboxes 28 and 29 e DataZ to mailboxes 30 and 31 Example 7 3 BOXO 0x04 Host communicating to MBOX Application BOX1 0x20 CONFIG_W command BOX2 0x2C Starting at Offset 0x2C the configuration starting point for MB26 BOX3 0x0C Number of bytes to write 12 bytes BOX4 0x06 APP_ID_MBOX26 0x06 AFE APP_ID 0x06 BOX5 0x18 Byte ID MBOX26 0x18 LPF Data starts at register 0x18 X MSB BOX6 0x06 APP ID MBOX27 BOX7 0x19 Byte ID MBOX27 Data X LSB BOX8 0x06 APP ID MBOX28 BOX9 0x1A Byte ID MBOX28 Data Y MSB BOX10 0x06 APP ID MBOX29 BOX11 0x1B Byte ID MBOX29 Data Y LSB BOX12 0x06 APP ID MBOX30 I D I UO UO BOX13 0x1C Byte ID MBOX30 Data Z MSB BOX14 0x06 APP I BOX31 BOX15 0x1D Byte ID MBOX31 Data Z LSB Bytes to send 0x04 0x20 Ox2C Ox0C 0x06 0x18 0x06 0x19
70. APP ID and six bytes of data Bytes to Send OxOF 0x30 0x03 Ox0A This results in the following response OF 80 0A OA 05 83 13 06 00 81 FF EA 11 OC The last six bytes are the AFE data X Y and Z This response was with the device flat in the Face Up orientation The X and Y data are close to Ox0000 or 0 g and the Z data is close to 0x1000 or 1 g MBO APP ID OxOF FIFO application MB1 STATUS 0x80 Command Complete no errors MB2 RequestedData count 0x0A 10 bytes of data MB3 Actual Data Count 0x0A 10 bytes of data MB4 0x05 FIFO Status Watermark and Overflow flag is set MB5 6 0x8313 Timestamp MB7 APP ID of the application providing the actual data 0x06 AFE application MB8 9 AFE X data 0x0081 MB10 11 AFE Y data OXFFEA MB12 13 AFE Z Data Ox110C The read size for one 1 6 byte payload is 10 bytes The size for two payloads is 17 bytes 3 24 bytes Reading three payloads Send the following command to set up for reading the status register Example 14 3 1 MBO Set APP ID to OxOF Selects the Low g application 2 MB1 Command to 0x30 Sends a Write Configuration space command 3 MB2 Set offset to zero 0x03 Starts writing configuration values at register 0 4 MB3 Set count field to 0x18 Reads 24 bytes 3 status byes 3x APP_ID 6 data MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 140 Freescale Semiconductor Inc Da
71. Ap Range of valid values 1 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 120 Freescale Semiconductor Inc Tap Detection Application 11 2 3 tap on max Table 11 5 tap on max register Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field tap on max Reset 0x78 Table 11 6 tap on max bit description Field Description tap on max Sets the maximum time that the signal must remain above the threshold in order to consider a tap event 7 0 Units Algorithm cycles Time Algorithm cycles 1 SRTAp Range of valid values 1 to 255 11 2 4 double tap min time Table 11 7 double tap min time register Offset 0x04 Bit 7 6 5 4 3 2 1 0 Field double tap min time Reset OxFF Table 11 8 double tap min time bit description Field Description double tap min ti Sets the time required between taps to qualify as a double tap rather than two separate taps If the me second tap occurs before the defined time the event is considered a double tap 7 0 Units Application cycles Time Algorithm cycles 1 SRrAp Range of valid values 1 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 121 Tap Detection Application 11 25 tap K HP Table 11 9 tap K HP register
72. Configures the hysteresis for back and front angle transition This value can be calculated based on the desired angle using the following formula hysteresis BAFRO sin desired angle 4096 Where the desired angle is between 0 and 30 Units Non dimensional Range of valid values 0 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 100 Freescale Semiconductor Inc Portrait Landscape Application 9 2 7 cfg Table 9 13 cfg register Offset 0x06 Bit 7 6 5 4 3 2 1 0 Field PLFDE PL EN BKFR EN DBCNTM Reset 0 1 1 0 0 0 Table 9 14 cfg bit descriptions Field Description PLFDE Indicates if an event is saved into the Event Q 0 No event saved to Event Q 1 Event saved to Event Q PL EN Enables 2D functionality 0 2D not enabled 1 2D enabled BKFR EN Enables 3D functionality 0 3D not enabled 1 3D enabled Reserved DBCNTM Debounce counter mode 0 The debounce counter decrements when the condition is no longer valid 1 The counter clears when the condition is no longer valid Reserved MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 101 Portrait Landscape Application 9 3 Portrait Landscape status registers 9 3 1 PL Out Table 9 15 PL Out register Offset
73. D SAR US deed CEA d doe oid d eR AA 164 IDE SAPP ID BM Dd icc act cen cn dna ed RE dcr rbd d Fre 164 16 2 1000mu BID SE RA 164 Weare ID OM 0E acer AA AA A AAA R4 164 a Tac Bk ID ED ers rienda 165 E SB BO AA 165 TRA IAE BLIO SR 06 ad REA de ori ate de end 165 IA D UM BI res dud iendar dud i RE e 165 16 2 160utput_Bit_ID SH DT 6 enc cede een rr re eR eee 166 16 3 Status Register default configuration ssc0eeeeencee ewes RR Rn 167 Chapter 17 Sleep Wake Application 17 1 Overview of Sleep Wake application 624i ccd cicada da ree A ORO RR CORR RR RR ens 169 EFL PERIERE adea E ded esp ee ee Ree der ac on d OU od Cue dici 169 ILLEDUSS DOE 14292293745 534 oS RR QE dada CE OES a ia dadxsdAdAdi 170 15 13900 MM 170 17 2 Sleep Wake configuration registers unanunua eee ee 172 Tal GSI ROR Lnd dude 3o ODER ede pelo Cd ioo OR e de qoo d ab o 172 17 2 2 doze tme thresh eg a Erde edd a ee ar Ro ak RR CORE RR CR ROC ERR ERO 172 Bie AAN 173 17 24 short_time_off nn ne eee ee baw e RR Rama REBEUR e e eR RR RR 174 LE MA sms dx dE ade dta addidi nda eee dd do dk e 175 17 3 Sleep Wake status registers aasasescossorruieasddebeRReo4 4 9 ccirehydasiReSS 176 17 3 1 scheduler_mode eua aca ack aer EORR OR ee OR CR CR CIRC RECS EIC DE C SC SCR C en 176 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 7 Section Number Title Page Chapter 18 Reset Suspend Clear Control Application 18 1 Overvie
74. D SR 03 Reset 0x03 16 2 9 APP ID SR 04 Table 16 9 APP ID SR 04 register Offset 0x08 Bit 7 6 5 4 3 2 1 0 Field APP ID SR 04 Reset 0x07 16 2 10 Output Bit ID SR 04 Table 16 10 Output Bit ID SR 04 register Offset 0x09 Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR 04 Reset 0x04 16 2 11 APP ID SR 05 Table 16 11 APP ID SR 05 register Offset 0x0A Bit 7 6 5 4 3 2 1 0 Field APP ID SR 05 Reset 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 164 Freescale Semiconductor Inc Status Register Application 16 2 12 Output Bit ID SR 05 Table 16 12 Output Bit ID SR 05 register Offset 0x0B Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR_05 Reset 0x00 16 2 13 APP ID SR 06 Table 16 13 APP ID SR 06 register Offset 0x0C Bit 7 6 5 4 3 2 1 0 Field APP ID SR 06 Reset 0x07 16 2 14 Output Bit ID SR 06 Table 16 14 Output Bit ID SR 06 register Offset 0x0D Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR 06 Reset 0x06 16 2 15 APP ID SR 07 Table 16 15 APP ID SR 07 register Offset OxOE Bit 7 6 5 4 3 2 1 0 Field APP ID SR 07 Reset 0x00 MMA955xL Intelligent
75. END Stage 0 ABSJ X output FRONTEND Stage 0 ABSJ X Reset 0x00 0x00 Offset OxOE MSB OxOF LSB Bil 7 eo amp ea ls ela OMEN EE RU Sie le 14 0 Field output FRONTEND Stage 0 ABS Y output FRONTEND Stage 0 ABS Y Reset 0x00 0x00 Offset 0x10 MSB 0x11 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_0_ABS Z output FRONTEND Stage 0 ABSJ Z Reset 0x00 0x00 Table 8 19 output FRONTEND Stage 0 ABS XYZ bit description Field Description output Absolute value normalized accelerometer data sampled at the default rate of 488 Hz with a FRONTEND Stage 0 ABS 100 Hz bandwidth XYZ Units 0 244 mg LSB Range of valid values 0 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 89 Analog Front End Application 8 3 4 output FRONTEND Stage 0 GM XYZ These registers bits are shown in the following table Table 8 20 output FRONTEND Stage 0 GM XYZ registers Offset Ox12 MSB 0x13 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_0_GM X output FRONTEND Stage 0 GMI X Reset 0x00 0x00 Offset Ox
76. EVENT Q Index of the function that pushes data into the Event FIFO FSL API FN REG USER INT Index of the function that registers users interruption functions FSL API FN REQ DATA RAM Index of the function that dynamically reserves RAM FSL API FN GET APMAP PTR Index of the function that gets the address of an entry in the application table FSL API FN APP OUT ADDR Index of the function that looks for and returns the address of the status registers for a given APP ID FSL API FN APP PARAM ADDR Index of the function that looks for and returns the address of the configuration registers for a given APP ID FSL API FN IIR FILTER Index of the configurable IIR filter function MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 199 A User Applications FSL API FN GET DATA PTR Index of the function that looks for and returns the address of the application data 21 3 Additional resources For additional information on developing custom applications see Installation of the MMA955xL CodeWarrior Service Pack ANA128 e Build Custom Applications on MMA9550 MMA9551L AN4129 To access the webpage with these documents see References on page 13 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 200 Freescale Semiconductor Inc
77. Event detected MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 125 P Tap Detection Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 126 Freescale Semiconductor Inc Chapter 12 Tilt Application 12 1 Overview of Tilt application This application senses the angle between the Y Z and X Z planes with the fixed reference to gravity The application also determines the quadrant of each of the enabled planes referenced to gravity The application collects the three axis data from the sensor and passes the accelerometer data through a low pass filter with a user configurable cut off frequency The filter output data determines the quadrant and the tilt angle Lum OxOB Default speed 122Hz Configuration Start on registers page 129 Status Start on registers page 132 The following figure shows the tilt application block diagram All the outputs referring to the X Y plane always read zero due to the ambiguous relationship between that plane and the axes Tilt Detection Application data logic i LP filter mke 1 o l tilt cfg1 Tilt_fifo_mask I Input parameters LL l Figure 12 1 Tilt application signal flow i tilt delta xz ang Application i n Sensor m ult delta yz ang tilt delta xy ang r Output events The following figure shows t
78. Event queue FIFOLGE Pushes the low g events into the Event queue Range of valid values from 0 to 1 0 Disables the push low g events to the Event queue 1 Enables the push low g events to the Event queue MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 114 Freescale Semiconductor Inc 10 3 High g Low g status register 10 3 1 Ihg out Table 10 15 Ihg out register High g Low g Application Offset 0x00 Bit Field HGE HGZ HGY HGX LGE LGZ LGY LGX Reset Table 10 16 Ihg out bit descriptions Field Description HGE Indicates the detection of logical AND OR of all the enabled high g events Range of valid values 0 No high g AND OR event detected 1 A high g AND OR event detected HGZ Indicates the detection of high g signals on the Z axis Range of valid values 0 No high g event detected on the Z axis 1 A high g event detected on the Z axis HGY Indicates the detection of high g signals on the Y axis Range of valid values 0 No high g event detected on the Y axis 1 A high g event detected on the Y axis HGX Indicates the detection of high g signals on the X axis Range of valid values 0 No high g event detected on the X axis 1 A high g event detected on the X axis LGE Indicates the detection of logical AND OR low g
79. MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Devices Supported MMA9550L MMA9551L MMA9553L Document Number MMA955XLSWRM Rev 0 04 2012 O eS 9 e freescale Xtrinsic Ene i Efficient Solutions by Freescale KY RX How to Reach Us Home Page www freescale com Web Support http www freescale com support MMA955XLSWRM Rev 0 04 2012 Information in this document is provided solely to enable system and software implementers to use Freescale products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document Freescale reserves the right to make changes without further notice to any products herein Freescale makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters that may be provided in Freescale data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including typicals must be validated for each customer application by customer s technical experts Freescale does not convey any license
80. OX x Units None Range of valid values 1 to 31 Values outside this range or values for a nonexistent application may cause unexpected system behavior Byte ID Indicates the byte number of the application s status or output registers that are being sent to this mailbox MBOX x The most significant byte for a specific application s output is identified as Byte 0 and the least significant byte is Byte x Units Non dimensional Range of valid values 0 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 72 Freescale Semiconductor Inc 7 2 2 Configuring XYZ data Mailbox Application The MBOX application aggregates application data and presents it in the mailboxes The AFE application APP ID 0x06 provides the XYZ accelerometer data with output registers O through 5 containing the FRONTEND Stage 0 XYZ data The following example shows what a host would send to the MMA955xL device to create the configuration to set up quick read mailboxes 4 9 to contain the following FRONTEND Stage 0 XYZ data Data X to mailboxes 4 and 5 Data Y to mailboxes 6 and 7 Data Z to mailboxes 8 and 9 Example 7 1 BOXO BOX1 BOX2 BOX3 BOX4 BOX5 BOX6 BOX7 BOX8 BOX9 BOX10 BOX11 BOX12 BOX13 BOX14 BOX15 0x04 0x20 0x00 0x0C 0x06 0x00 0x06 0x01 0x06 0x02 0x06 0x03 0x06 0x04 0x06 0x05
81. P ID GPIO7 Reset OxFF Table 6 5 SR bitnum GPIO7 register Offset 0x03 Bit 4 3 Field SR bitnum GPIO7 Reset 0x00 Table 6 6 APP ID GPIO8 register Offset 0x04 Bit 4 3 Field APP ID GPIO8 Reset OxFF MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 64 Freescale Semiconductor Inc Table 6 7 SR bitnum GPIO8 register GPIO Application Offset 0x05 Bit 7 6 4 3 1 0 Field SR bitnum GPIO8 Reset 0x00 Table 6 8 APP ID GPIOO register Offset 0x06 Bit 7 6 4 3 1 0 Field APP ID GPIO9 Reset OxFF Table 6 9 SR bitnum GPIOO register Offset 0x07 Bit 7 6 4 3 1 0 Field SR bitnum GPIO9 Reset 0x00 Table 6 10 GPIO pol MSB register Offset 0x08 MSB Bit 7 6 4 3 1 0 Field Reserved GPIO9 GPIO8 Reset 0x00 0 0 Table 6 11 GPIO pol LSB register Offset 0x09 LSB Bit 7 6 4 3 1 0 Field GPIO7 GPIO6 Reserved Reset 0 0 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 65 GPIO Application 6 2 2 GPIO polarity configuration Table 6 12 GPIO output depending on polarity configuration and bit value Input Bits Output Bit GPIO POLARITY SR bit x
82. RR E ode eg ol b oer i a e eed 20 20 SR MAID Lio esa qct Reden ded od bE d Roo poa debo RR nd 21 2 5 1 APOCO NISSAN edebat e e ed os 22 26 Registers gri TE ELTTTIT ITI TIT A E T 23 Chapter 3 Version Application 3 1 Reading the version information nuca oec de aod o RR CROCO GR eR a RE 32 Chapter 4 Scheduler Application 4 1 Scheduler operational overview 20 0000 eee 34 4 2 Scheduler application elements 00 000 cee eee 34 aal PINE GG iss dob dod qiie prd ad dbi dal CEH eh dodi o ERR dob 35 42 2 BORA MORE 210 paciba da ed dod ooa ER AAA RERE HR Me 36 B NEUES aasctcocx dabo qa a cades Cr T9 head i A EC Oe Ree ale de eR dp 37 4 4 Scheduler preemption ooooocococccccconr n 39 4 4 1 High priority task suspending low priority task oooooocoooo 39 4 4 2 Low priority task becoming ready during high priority task 40 ES BUG Coe 1er qu 3 R3 dU Ed atera 41 4 6 Scheduler configuration registers 0c cee eee 42 4 6 1 request_to_start register oua Lava o GO EACR ee GC CORO E OR CIE SCC Can 43 4 6 2 request to start register configuration example oooooocconoo o 44 4 6 3 Interrupt assignment registers llle 45 4 6 3 1 Interrupt App IDs register configuration example 49 4 6 4 Scheduler parameters register ooooocooocconcnnooorr o 50 4 7 Scheduler status registers uxore Rr FEAR OCA QUE BAKER 4e ER Roe Re boe RR ER o 53 qnl
83. Rev 0 Freescale Semiconductor Inc 39 Scheduler Application 9 The scheduler clears the counter application started flag and pops the idle state context from the stack and returns to the idle state 4 4 2 Low priority task becoming ready during high priority task This example shows how the scheduler functions when a low priority task becomes ready while a high priority task is being executed This operation uses three tasks idle MTIMOV and SFD Idle A low power wait state MTIMOV A low priority used by the pedometer application and triggered by the MTIM counter overflow SFD A high priority used to sample the ADC trim and filter Example 4 2 In this scenario the MMA955xL platform behaves as follows l Ze Starting in the idle task AFE results become ready and trigger an SED interrupt The scheduler acknowledges the SFD interrupt to the hardware and marks the SFD task as request to start The scheduler determines the SFD task is the highest priority executable task pushes the idle task context onto the stack clears the SFD request to start flag sets the SFD started flag and returns to the SFD task to sample the ADC trim and filter 4 Before the SFD task completes an MTIMOV interrupt occurs The scheduler acknowledges the interrupt to the hardware by clearing a flag in an MTIM register and marks the MTIM task as request to start The scheduler determines the SFD task is still the high
84. Similar to the command format the response format follows the specific application s format Mailboxes are filled with data depending on the target application All responses start with the responding APP ID the COCO the ERROR STATUS the actual data count and the requested data count The format of the remaining data bytes is specific to the responding application Table 5 4 Mailbox response formats Mailbox 7 6 5 4 3 2 1 0 0x00 Application ID APP ID 0x01 COCO Error code 0x02 Actual number of bytes read written 0x03 Requested number of bytes to read write 0x04 Read data 0 0x05 Read data 1 0x06 Read data 2 Read data n MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 60 Freescale Semiconductor Inc Communication Interface The following table describes the details of the different parts and fields of a response message Table 5 5 Mailbox response format details Block Description Application ID The ID of the application that is responding See the preceding table APP ID Command complete COCO This bit must be set to Ob when a command is written and is set to 1b by the MMA955xL platform when the command has been processed The other registers do not contain valid results until this bit is set Eworcoda The seven bytes that store the error code of the command A zero indicates there was no error For more infor
85. Table 15 5 queue timeout registers Offset 0x04 MSB 0x05 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field queue_timeout Reset Table 15 6 queue_timeout bit description Field Description queue_timeout Sets the count in cycles for the Event Queue to set or clear the time out flag Units Time queue timeout 1 SRqueuel Range of valid values 0 to 65 535 SR queue is the sample rate of the Event Queue application which defaults to 488 Hz MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 157 Event Queue Application 15 3 Event Queue status registers 15 3 4 records number Table 15 7 records number registers Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field records_number Reset Table 15 8 records_number bit description Field Description records number Shows the current number of entries or records stored in the queue Units Entries Entry six bytes Range of valid values 0 to 65 535 Realistically this number should never be more than the available RAM divided by the payload size 15 3 2 entry size Table 15 9 entry size registers Offset 0x02 Bit 7 6 5 4 3 2 1 0 Set bit values 0 0 0 0 0 1 1 0 Field entry size Res
86. This data in the Quick Read registers in Legacy mode can be changed with the Mailbox application 19 4 Configuring mailbox operational mode The operational mode of the slave communications interface mailbox is configured via the Mailbox Configuration application This application allows the host system to configure the slave communications interface functions including the mailbox transaction interrupt pin mode mailbox Normal Legacy modes and transaction streaming modes The following example shows how to configure the mailbox operating mode from Normal to Legacy Example 19 1 MBO Set the APP ID Mailbox Mode Config application identifier 0x18 MBI Set the Command Write Config application identifier 0x20 MB2 Set the Offset to Zero field 0x00 to point to the configuration register MB3 Set the Count field to 0x01 because only one data byte needs to be sent MB4A Set the DATA value to 0x10 This sets the Legacy field to 1b which selects the Legacy mode Bytes to send 0x18 0x20 0x00 0x01 0x10 OP Se B or 19 5 MBOX Configuration memory map and register 19 5 1 MBOX Configuration memory map Table 19 1 memory map Offset Register Access Reset Details address 0x00 MBOX Configuration register Read Write 0x00 page 192 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 191 MBOX Configuration Application 19
87. Tilt Application 12 2 2 tilt cfg1 Table 12 4 tilt cfg1 register Offset 0x01 Bit 7 6 5 4 3 2 1 0 Field Reserved XYEN YZEN XZEN Angle thresh 3 0 Reset 0 1 1 1 1 0 0 1 Table 12 5 tilt cfg1 bit descriptions Field Description Reserved Bit field reserved XYEN Enables or disables the sensing of the X Yplane Range of valid values from 0 to 1 0 Disables X Y plane sensing angle 1 Enables X Y plane sensing angle YZEN Enables or disables the sensing of the Y Z plane Range of valid values from 0 to 1 0 Disables Y Z plane sensing angle 1 Enables Y Z plane sensing angle XZEN Enables or disables the sensing of the X Z plane Range of valid values from 0 to 1 0 Disables X Z plane sensing angle 1 Enables X Z plane sensing angle Angle thresh Configures a delta angle threshold Whenever the algorithm detects a delta angle variation above the established threshold from one execution to the next the angle flag is set Units Degrees Range of valid values 1 to 10 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 130 Freescale Semiconductor Inc Tilt Application 12 2 3 tilt event mask Table 12 6 tilt event mask register Offset 0x02 Bit 7 6 5 4 3 2 1 0 Field Quad Change Reserved Reset 0 0x00 Table 12 7 tilt event mask bit d
88. VAL GPIO x 0 0 0 0 1 1 1 0 1 1 1 0 6 2 3 GPIO application bit descriptions Table 6 13 GPIO application bit descriptions Field Description APP ID GPIOx The application identifier APP ID of the application assigned to the GPIO pin A value of OxFF indicates 7 0 there is no application assigned After a reset no application output bits are mapped to a GPIO Units None Range of valid values 0 31 and OxFF SR bitnum GPIOx The bit number of the application status registers being assigned to the GPIO pin 7 0 The bit number depends of the amount of output bytes and the position of the bit in the register For example if the QUADFLAG bit in tilt xz yz xy quad register of the Tilt algorithm to be assigned SR bitnum 31 because it corresponds to the seventh bit of the fourth output byte For more information see Tilt Application on page 127 Units None Range of valid values 0 255 GPIO polx Defines the output polarity of the GPIO pin designated by the n variable in the field name This register uses negative logic 0 to configure active high and 1 for active low Table 6 2 on page 64 indicates which pin of the register corresponds to each GPIO Units None Range of valid values 0 Output is active high output bit high gt high on GPIO pin 1 Output is active low output bit high gt low on GPIO pin Reserved Indicates that the bit is reserved MMA955xL Intell
89. a sampling and filtering to preempt long duration low priority tasks The scheduler scans serially through the list of applications looking for applications that have the same priority as the scheduler s current priority When there is a priority match an activity level is checked to determine if the application should be run in the current scheduler s interval An application s activity mask can be set to High Low Both or None This feature allows an application to run during high activity low activity both or not at all The Sleep Wake application defines the thresholds of activity between Sleep and Wake or High and Low activity Priorities from 16 to 23 are linked directly to the frame execution rate See Table 4 1 on page 35 The lower priority levels provide a range of values for managing applications in the user system The scheduler automatically executes all the applications with a priority corresponding to the scheduler s current running priority level Once the scheduler has identified an application to run it does a context switch to that application When the application completes context is returned to the scheduler and it looks for more applications with the same priority MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 33 Scheduler Application 4 1 Scheduler operational overview The basic operational steps of the scheduler include 1 The sched
90. able identifier the application identifier APP ID the number of configuration and output registers and pointers to the initialization reset clear and application functions To enable the scheduler to find the applications at boot time they must be linked and located at specific addresses in the flash memory Multiple applications can be handled by the scheduler provided there is sufficient space available in memory Users can implement up to three application tables Each application table can contain many applications For more details see User Applications on page 197 The following image shows the flash memory map with the Freescale and user memory sections MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 18 Freescale Semiconductor Inc Introduction app table t app table N 512 TABLE_IDENTIFIER table identifier 0x9559CODE 1 num_of_applications cbFunction amp initCbFunction init function address cbFunction amp resetCbFunction reset function address cbFunction amp clearCbFunction clear function address cbFunction amp UserApplication main function address uint8 t CUST FBID application id Primary Freescale firmware 7 number of parameter bytes 1 number of output bytes 2 4 1 call back block for application 2 if used f void initCbFucntion void First user image EX Request memory RAM for
91. ad section of the Mailbox registers MB20 MB31 In Legacy mode the lower mailbox registers continue to operate in the command response mode and the upper registers operate in the Quick Read mode The data in the Quick Read registers is automatically updated so a read request command is not required before reading the data form the upper mailboxes The following examples show how to wake up the device configure it for quick reading the low passed filtered XYZ data enable the Legacy mode and read the data The MMA955xL platform comes out of reset in the Low Power or Sleep mode In order to start the AFE application and start collecting samples the MMA955xL must be brought out of Sleep mode and into Run mode This example shows how to disable Sleep mode and enable Wake mode Example 7 2 MBOXO 0x12 Host communicating to Sleep Wake Application MBOX1 0x20 CONFIG Write command MBOX2 0x06 Starting at Offset 0x6 MBOX3 0x01 Number of bytes to write 1 byte MBOX4 0x00 Write 0x00 which wakes up the device Bytes to Send 0x12 0x20 0x06 0x01 0x00 The AFE application APP ID 0x06 provides the XYZ accelerometer data with output registers O through 5 containing the FRONTEND Stage 0 XYZ data By default the Quick Read registers MB26 MB31 are assigned 0x00 Analog Front End Stage 0 X MSB The AFE application however provides XYZ low pass filtered data in registers 0x18 through Ox1D FRONTEND 4
92. an error condition When this occurs the host must retry reading the data If any other error is returned the host must take the proper action 15 1 3 Event Queue block diagram The following figure shows the Event Queue Data Flow Model that receives the Application ID and N size of the payload from a specific application The Event Queue logic appends the frame counter with this data and pushes the entry six bytes in size into the queue If the queue is full the logic will ignore the push request APP AP ID 16 bit frame count AP ID Payload Various elements in the application can set or clear bits in this register Data Array Host decides Command calls a the size pop routine to dump in bytes the memory Event Queue Mask Register Config command can a a Asp Mt HM MUN Modify this register Full WM First entry after reset Frame Event Queue Flag Re ister alsa m Counter GPIO mapping logic Interrupt Payload N Config command can modify this table Push subroutine Figure 15 2 Event Queue data flow MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 155 Event Queue Application 15 2 Event Queue configuration registers The Event Queue application s configuration can only be written once In order to re configure the Event Queue the whole device must be reset This is because the Event Queue applica
93. apd US ka A a ene ando ici Ad 115 Chapter 11 Tap Detection Application 11 1 Overview of Tap Detection application llli 117 11 2 Tap Detection configuration registers 00 ee 120 FINE MOL REA EO Oe ONO 120 a IP OE BUE ado pd ed b pO V N CR CREDI dp ODE eR ROREM 120 ELE NE MEME dadas acd doe Qui qc pit ado CE IO de wee RE EORR C RES ACD oes 121 1124double tap min MITIS carcinoma hb ad Ra P RE dre 121 TESI h HP o A qu sna d ard al Du dd qp daa dae diri dod 122 IIR M DP audae us viden dde d os R RS d cua diio iib ROME SR d aa ai d 122 HI ap INS A 123 11 2 8 tap_events MaSk a ebd d qaoqae aco OE AC ede dC EUR de Re Rex RR RR Rd 123 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 5 Section Number Title Page 11 3 Tap Detection status registers cc cnc erexkeeb saad eee ER 60008 RR ERA CR ncn 124 A al DUE uisa qt renep 19 4x daba dodi i d god dic iod d ee ee ee MCN 124 e ee 294445239 eee eee here JA RA REOR eT er bp REFER EAE 125 Chapter 12 Tilt Application 12 1 Overview of Tilt application 0 0000 ee 127 12 2 e MA 129 ELA A LE PA LE eter iate ee nee ere eee err ere 129 A E hn bone oA PM 130 ELSE eveni MASK Lada doa add dod plot ORE EC p eX EX ED Id EM 131 123 WD status TRIBUNE ons pecan katana of up IIA 132 TES UE Hells SE A0 Loa ok nad a uada a o Re Rc dea e oe 132 12 3 2 tilt_delta_yz_ang cc cc dees Resa do e 133 Tee Nella AAA arrasa
94. application s outputs The clear flag is automatically cleared by the scheduler When an application s clear bit is set it causes the following actions e The application s clear callback is executed This typically resets the application s outputs The clear flag is cleared e The application is executed 18 2 Configuration registers for Reset Suspend Clear Control applications 18 2 1 Reset configuration register Table 18 1 Reset registers Offset MSB 0x00 reset bits 31 24 Bit 31 30 29 28 27 26 25 24 Field Reserved User User User User User User Application Application Application Application Application Application Reset 1 1 1 1 1 1 1 1 Offset 0x01 reset bits 23 16 Bit 23 22 21 20 19 18 17 16 Rst Susp Clr User User User User Auto Wake Status Event FIFO Field e i SAO PES Application Application Application Application Sleep Reset 0 1 1 1 1 1 1 1 Offset 0x02 reset bits 15 8 Bit 15 14 13 12 11 10 9 8 Data FIFO Frame User User Tilt Sensing Tap Detect LG HG Field AU S Counter Application Application Reset 1 1 1 1 1 1 1 1 Offset LSB 0x03 reset bits 7 0 Bit 7 6 5 4 3 2 1 0 Field PL AFE Reserved MBOX GPIO CI Scheduler General Rst Reset 1 1 1 1 1 1 1 1 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 178 Fre
95. are copied into user mode shadow registers Table 4 6 user interrupt registers Offset 0x04 MSB 0x05 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field SFD Interrupt AppIDs 31 24 SFD Interrupt_AppIDs 23 16 Reset 0x00 0x00 Offset 0x06 0x07 LSB Bu vola aia Bail elt ae age ars al SEES Eg Field SFD Interrupt AppIDs 15 8 SFD Interrupt AppIDs 7 0 Reset 0x00 0x00 Offset 0x08 MSB 0x09 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field AFE COCO Interrupt AppIDs 31 24 AFE COCO Interrupt AppIDs 23 16 Reset 0x00 0x00 Offset 0x0A OxOB LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field AFE COCO Interrupt_AppIDs 15 8 AFE COCO Interrupt_AppIDs 7 0 Reset 0x00 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 45 Scheduler Application Table 4 6 user interrupt registers continued Offset Ox0C MSB Ox0D Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field IRQ Interrupt_AppIDs 31 24 IRQ Interrupt AppIDs 23 16 Reset 0x00 0x00 Offset OxOE OxOF LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field IRQ Interrupt AppIDs 15 8
96. ars the debounce counter 1 Decrements the debounce counter HGOAE Sets whether the high g outputs will be ORed or ANDed Range of valid values from 0 to 1 0 Enables the logical AND combination of the high g X Y and Z axes 1 Enables the logical OR combination of high g X Y and Z axes HGZEE Enables or disables the high g sensing for the Z axis Range of valid values from 0 to 1 0 Disables high g event on Z axis 1 Enables high g event on Z axis HGYEE Enables or disables the high g sensing for the Y axis Range of valid values from O to 1 0 Disables the high g event on the Y axis 1 Enables the high g event on the Y axis HGXEE Enables or disables the high g sensing for the X axis Range of valid values from 0 to 1 0 Disables the high g event on the X axis 1 Enables the high g event on the X axis MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 113 High g Low g Application 10 2 7 Ihg event mask Table 10 13 Ihg event mask register Offset 0x09 Bit 7 5 3 1 0 Field FIFOHGE FIFOLGE Reset 0 0x00 0 0x00 Table 10 14 Ihg event mask bit descriptions Field Description FIFOHGE Pushes the high g events into the Event queue Range of valid values from 0 to 1 0 Disables the push high g events to the Event queue 1 Enables the push high g events to the
97. at the new values programmed into the flash are copied to the working RAM area After a pin reset the microprocessor boots depending on some system parameters and starts the scheduler The scheduler checks every 512 byte flash memory page boundary for valid application tables that are identified at the start of the page by the four byte keyword 0x9550CODE The scheduler initialization sequence then builds a list of applications from the application tables to quickly access the application properties during normal runtime execution Any applications set to the same priority are executed in the order defined by the application table Application tables at lower addresses are processed before those at higher addresses It is up to the user to select App_IDs that do not conflict with Freescale applications or other user provided applications If an APP_ID is reassigned unpredictable system behavior may result MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 21 Introduction 2 5 1 Application identifiers Freescale provides a suite of preloaded applications that vary with each device member of the MMA955xL family The following table shows those applications their APP IDs and whether they can access the configuration and status registers The table also shows whether the application is preloaded for a device and the application s run rate if it is supported by the d
98. ata 2 Write data n The following table gives the details of the different parts of the data packet for a Write command Table 5 2 Mailbox command format details Block Description Application ID Application targeted for the issued command See the next table Command Command to be performed 0 Read application fixed bytes version information 1 Read application configuration bytes 2 Write application configuration bytes 8 Read application status or output Byte offset Sets the offset of the first byte to be accessed counting from the start of the register space This enables a subset of the registers to be accessed by setting the start location to something other than zero Requested number Number of bytes requested to be read or written of bytes Write data The data being written MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 57 Communication Interface 5 3 2 Application IDs names and descriptions The following table gives the names and IDs of the Freescale applications associated with MMA95590L MMA95591L and MMA95593L platforms Table 5 3 Application descriptions Application ID Application Name Description Returns a 12 byte pack with the device identifier number and the version 0x00 Version numbers of the ROM firmware and hardware For more details see
99. be put into a Stop mode where time passes but no samples are taken It does not count when the device is in stop mode Status Start on registers page 135 13 2 Frame Counter configuration registers There are no configuration registers for this application 13 3 Frame Counter status register 13 3 1 frame cnt Table 13 1 frame cnt registers Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 1 0 Field frame cnt Reset 0x00 Table 13 2 frame cnt bit description Field Description frame cnt Counter with the total of frames at 488 Hz Units Non dimensional Range of valid values 0 to 65535 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 135 Frame Counter Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 136 Freescale Semiconductor Inc Chapter 14 Data FIFO Application 14 1 Overview of Data FIFO application cum OxOF The Data FIFO First In First Out application is a buffer intended to store Default speed 488 H the output data from an application Every scheduler interval the Data FIFO ES iun application gathers the output data from an application and stores it until the Configuration Start on host processor reads the data registers page 145 The FIFO application uses the mailboxes differently than other Status Start on applications operating in the streaming mode In streaming mode t
100. bounce counter 1 Decrement the debounce counter LGOAE Sets whether the low g outputs will be ORed or ANDed Range of valid values from 0 to 1 0 Selects logical AND combination of low g X Y Z axes event flag 1 Selects logical OR combination of low g X Y Z axes event flag LGZEE Enables or disables the low g sensing for the Z axis Range of valid values from O to 1 0 Low g event on Z axis disable e 1 Low g event on Z axis enable LGYEE Enables or disables the low g sensing for the Y axis Range of valid values from 0 to 1 0 Disables low g event on Y axis 1 Enables low g event on Y axis LGXEE Enables or disables the low g sensing for the X axis Range of valid values from 0 to 1 0 Disables low g event on X axis 1 Enables low g event on X axis 0g detection example The device powers up in Sleep mode but it may become necessary to wake the part This process uses the following mailboxes MBO 0x12 App ID 0x12 Power Controller modes MB1 0x20 Command 0x2 Write configuration Offset Ob MB2 0x06 Offset 0x06 MB3 0x01 Count of data to write MBA 0x00 Actual Data Value Clears the Sleep bit Bytes to Send 0x12 0x20 0x06 0x01 0x00 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 109 High g Low g Application Example 10 1 To configure the MMA955xL platform to detect Og type events write the followin
101. case Specific bits fields or ranges appear in brackets For example RAMBAR BA identifies the base address field in the RAM base address register A four bit data unit An eight bit data unit A 16 bit data unit A 32 bit data unit In some contexts such as signal encodings x indicates a do not care Used to express an undefined numerical value NOT logical operator AND logical operator OR logical operator Field concatenation operator Indicates that a signal is active low MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 11 About This Document 1 4 Register figure conventions This document uses the following conventions for the register reset values The bit is undefined at reset u The bit is unaffected by reset signal name Reset value is determined by the polarity of the indicated signal The following register fields are used Read 0 Indicates a reserved bit field in a memory mapped register These bits are always read as O Write Read 1 Indicates a reserved bit field in a memory mapped register These bits are always read as 1 Write Read Indicates a read write bit FIELDNAME Write Read FIELDNAME Indicates a read only bit field in a memory mapped register Write Read Indicates a write only bit field in a memory mapped register Write FIELDNAME Read FIELDNAME Write 1 to clear i
102. ch application is encoded by the lower six bits in the scheduler parameters registers See Scheduler parameters register on page 50 Priorities from 0 to 15 0x00 to OxOF can trigger an application when an interrupt occurs Priorities 16 to 23 0x10 to 0x17 are linked to the Analog Front End AFE execution rate All applications with a priority of 16 to 23 are automatically software triggered by the Scheduler Table 4 1 Priorities descriptions Priority Level Description 0x17 Applications with this priority run at 488 Hz 0x16 Applications with this priority run at 244 Hz 0x15 Applications with this priority run at 122 Hz 0x14 Applications with this priority run at 61 Hz 0x13 Applications with this priority run at 30 Hz 0x12 Applications with this priority run at 15 Hz 0x11 Applications with this priority run at 7 Hz 0x10 Applications with this priority run at 3 Hz OxOF Highest user assignable priority level lower than 3 Hz MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 35 Scheduler Application Table 4 1 Priorities descriptions continued Priority Level Description OxOE Ox0D 0x0C Ox0B Ox0A 0x09 0x08 User assignable priority levels 0x07 0x06 0x05 0x04 0x03 0x02 0x01 0x00 Lowest user assignable priority level 4 2 2 Activit
103. d user application Range of valid values For valid values for FS and CM parameters see the MMA955xL 3 Axis Accelerometer Reference Manual MMA955xLRM 0 No temperature sensor output will be measured during the next analog acquisition phase 1 The temperature sensor output will be measured during the next analog acquisition phase CM Conversion Mode Controls the ADC resolution accuracy versus power and conversion time trade offs Units None 00 Conversion complete in 32 cycles 01 Conversion complete in 16 cycle 10 Conversion complete in eight cycles 11 Conversion complete in four cycles Reserved Bit field reserved MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 83 Analog Front End Application 8 2 2 user offset XYZ Often due to the user manufacturing process the accelerometer sensor is not mounted perfectly flat to the board and may also be rotated slightly This register enables a user to make an after manufacturing calibration correction Table 8 7 user offset XYZ registers Offset 0x02 MSB 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field user_offset X user_offset X Reset OxFF OxFF Offset 0x04 MSB 0x05 LSB EMEND Ma ee Pa EN EXE E XE Field user offset Y user offset Y Reset OxFF OxFF Offset 0x06
104. da cda pasa adm 133 ARE AAA INO ade eR UR OR E ACCORD 134 Chapter 13 Frame Counter Application 13 1 Overview of Frame Counter application llle 135 13 2 Frame Counter configuration registers 2 sssccceaceeesveu seb iasedaunewone 135 13 3 Frame Counter status register occococoneonraciar ce RR us rd 135 EE eng hy O A 135 Chapter 14 Data FIFO Application 14 1 Overview of Data FIFO application rcociosnosisarzaara casera na raras 137 142 Modes of operation carro DA A 137 14 2 1 Stop on overflow MA TR c doo DER CUR EC ng app ee dede 137 JE LE NOS dra da dca eodd dede d Eoo ado 138 14 3 eg ia heh Ra Red dod aod Fo ORARE ACH RR KR deua atr cR NER abe 138 14 4 Data FIFO block diagram rra diio eni a o wee RH Ac RS Rc ica e uH ca en 143 14 4 1 Entries format sues eoa Rm RR eee RR E eee 144 143 Data FIFO configuration registers ccc iim ac sew dd n PEE Ro ire 145 14 5 1 FIFO conpfig ralon ERR a fake cae bp edhe rd E Rn eie RR 145 14 5 2 FIFO SIZE DIE ca dansk Ki bk ew TODA AAN ARA A ee hy aS a a 146 iste er on 524 4E ee ced cab doo OR P blo oboe bab decer 146 e AM 147 146 Data FIFO stat s EOI c lt sacuciardecin ara acierta rise 148 14 6 1 Records number ovococorroocororrmrr rar p RR rr 148 A MAA E Modes a dE Qo e ead er DR e Mod 149 TM PIB ES arua did on UR OCURRE oe i ERR ERED CADE RO d PRIOR CR 149 Chapter 15 Event Queue Application 15 1 Overview of Event Queue application liliis 151 35 1 1 Modes of
105. different parameters of the low g application The application 0x09 Low g detection identifier reads the output bytes from its output structure For further details see Chapter 10 High g Low g Application OxOA Tap detection Configures different parameters of the tap detection application The application identifier reads the output bytes from its output structure 0x0B Tilt sensing Configures parameters of the tilt detection application and reads the output bytes from its output structure 0x0C 0x0D Available for user applications Application IDs that can be used for user applications Ox0E Frame counter Reads the system frame counter value OxOF Data FIFO Configures parameters of the Data FIFO application and reads the output bytes from its output structure and the contents of the FIFO buffer 1 Shaded rows indicate unused application identifiers available for user applications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 58 Freescale Semiconductor Inc Communication Interface Table 5 3 Application descriptions continued Application ID Application Name Description Configures parameters of the Event queue application and reads the output 0x10 Eva queue bytes from its output structure and the contents of the Event queue buffer 0x11 Status register Provides access to the MMA955xL platform s system status information 0x12 Sake Sleep Configures the power control mode
106. e Command Write Config application identifier 0x20 Set the Offset to Zero field 0x00 to point to the request to start configuration register Set the Count field 0x04 to writing four bytes Set the DATA value to OxAA Set the DATA value to OxBB Set the DATA value to OxCC Set the DATA value to OxDD Bytes to send 0x01 0x20 0x00 0x04 OxAA OxBB OxCC OxDD MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 44 Freescale Semiconductor Inc Scheduler Application 4 6 3 Interrupt assignment registers There are 10 possible interrupts in the MMA955xL platform Each interrupt is assigned to an application through the user interrupt parameter registers When an interrupt happens the scheduler handler logically ORs the contents of the user interrupt register with the request to start parameter register The scheduler runs the appropriate application the next time the application s priority is runable The scheduler uses the interrupt vector to determine which application ready interrupt occurred and sets a bit in the request to start register In the bit vector each bit corresponds to a task and the bit position indicates the priority of the application The appropriate interrupt is acknowledged to the hardware usually by clearing a flag bit in the peripheral s memory mapped status register In the special case that an AFE results ready interrupt occurred supervisor only AFE registers
107. e MMA955xL platform responds as follows 1 The interrupt handler acknowledges the interrupt to the hardware by clearing a flag in an MTIM register and schedules the counter application to run by setting the APP ID bit in the request to start register 2 Thescheduler determines that the counter application is the highest priority executable application pushes the idle state context onto the stack and calls the counter application 3 While the counter application is still running the Analog Front End AFE results become available which triggers another interrupt 4 The interrupt handler acknowledges the interrupt to the hardware and schedules the data processing application to run by setting the data processing application s bit in the request to start register 5 The scheduler determines that the data processing application is the highest priority executable task pushes the counter application context and calls the data processing application task to sample the ADC trim and filter 6 Sometime later the data processing application finishes and returns to the scheduler via the invoke scheduler call 7 The scheduler clears the data processing application started flag pops the counter application context from the stack and returns to the counter application to resume the pedometer application 8 The counter application completes and returns to the scheduler MMA955xL Intelligent Motion Sensing Platform Software Reference Manual
108. e Manual Rev 0 132 Freescale Semiconductor Inc Tilt Application 12 3 2 tilt delta yz ang Table 12 10 tilt delta yz ang register Offset 0x01 Bit 7 6 5 4 3 Field ANGFLG YZANGLE 6 0 Reset 0 0x00 Table 12 11 tilt_delta_yz_ang bit descriptions Field Description ANGFLG Stores the angle flag that is set whenever the difference from the current angle with the last calculated angle is bigger than the configured threshold Units Flag Range of valid values 0 to 1 0 No occurrence of delta angle above threshold 1 Delta angle went above threshold YZANGLE Stores the tilt angle of Y and Z axes Units Degrees Range of valid values 0 to 90 12 3 3 tilt delta xy ang Table 12 12 tilt delta xy ang register Offset 0x02 Bit 7 4 3 Field ANGFLG XYANGLE 6 0 Reset 0 0x00 Table 12 13 tilt delta xy ang bit descriptions Field Description ANGFLG Disabled by default and always reads zero Units Flag Range of valid values Always reads zero XYANGLE Disabled by default and always reads zero Units Degrees Range of valid values Always reads zero MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 133 Tilt Application 12 3 4 tilt xz yz quad Table 12 14 tilt xz yz quad register Offset 0x03 Bit 7 6 5
109. e Manual Rev 0 82 Freescale Semiconductor Inc Analog Front End Application 8 2 AFE configuration registers 8 2 1 afe csr Table 8 5 afe csr registers Offset 0x00 MSB 0x01 LSB Bit 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 y FS Ext Tem CM Reserved Reserved Field ADC p Reset 0x00 0 0 0x00 0x00 0x00 Table 8 6 afe csr bit descriptions Field Description FS Full scale selection AFE CSR FS and AFE BIAS SC AAF EN are combined to control AFE gain and tgrim mode Units Note Range of values For valid values see the MMA955xL 3 Axis Accelerometer Reference Manual MMA955xLRM Ext ADC Specifies whether an external input will be measured during the next analog acquisition phase Note The ExtADC and Temp bits must not be set at the same time Units None 0 No external input is measured during the next analog acquisition phase 1 Enables the four AFE channels to measure the external analog input during the next analog acquisition phase Temp Specifies whether the temperature sensor output will be measured during the next analog acquisition phase Note The ExtADC and Temp bits must not be set at the same time Units None Temperature will change slowly so it can be measured with a very low sample rate 1Hz or less by occasionally replacing an external ADC measurement with the Temperature ADC measurement This could be done with a customize
110. e bit description Field scheduler_mode Description Units None Range of valid values O to 0x02 10 Run mode 00 Doze mode Frame rate determined by the long time off configuration register 01 Doze mode Frame rate determined by the short time off configuration register Shows the scheduler mode when the SCHED and FLEEN bits are set in the cfg register If those bits are not set the value of this register may not reflect the actual scheduler mode MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 176 Freescale Semiconductor Inc Chapter 18 Reset Suspend Clear Control Application 18 1 Overview of Reset Suspend Clear Control ppitcation 0x17 application Default speed 488 Hz This application provides a way to reset suspend and clear the outputs of the applications in the MMA955xL device The reset and clear functions Configuration wie d are implemented in each application as call back functions The suspend registers P Po 184 function is handled in the Scheduler Application Status None One of the requirements of an application on the MMA955xL device is registers that it have a reset and clear function that can be called by the scheduler or another application This chapter describes how an application s reset and clear callback functions can be called or triggered There are three groups of configuration registers for the R
111. e device is sitting undisturbed flat on a desk top 17 1 1 Run mode In Run mode all applications are scheduled to run at their maximum established frame rate An application enters Run mode if the following conditions are met The GPIO interrupt is asserted RGPIO4 INT e A write command is issued from the host to the accelerometer e Movement above the threshold is detected and the previous state was Doze mode MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 169 Sleep Wake Application Run mode all applications executing Sleep mode nothing done Movement above threshold detected Sleep 1 No movement or host command for the short configured time Some movement Doze mode detected Doze mode long time between X shorttime between AFE samples AFE samples No movement or host command for the short configured time Average sample rate 0 Hz SR 1 long time Hz SR 1 short time Hz SR 488 Hz SR Figure 17 1 Platform s power modes state diagram 17 1 2 Doze mode In Doze mode the application only executes four AFE samples at a sample rate defined by the user The user can configure two sample rate values long time and short time These parameters are configured in the long_time_off and short_time_off registers respectively The short time sample rate is used when the sensor detects so
112. ed Status Start on minimum and maximum duration A double tap is two consecutive taps registers page 124 occurring in a user defined period of time The acceleration data in the different ranges 2g 4g or 8g is scaled or normalized to 8g full scale to ensure that the tap detection application will work the same in all ranges This algorithm works best with 8 g and 4 g front end configurations This is because a 2 g configuration could produce saturated accelerometer values and report unexpected event or direction results Most taps have a magnitude greater than 0 75g and last for about 0 05 seconds Double taps generally are spaced at 0 2 seconds Signal flow Energy detection logic i Output events 1 i tap axis event and state i tap axis sign machine dtap axis eventi i dtap sign event tap_thresh tap K HP r tal KT l tap_on_min l aS tap on max Input parameters tap tap min time Figure 11 1 Tap detection application signal flow MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 117 Tap Detection Application Tap event dicos tap_max tap max tap min tap min time l tap_min tap_min_time l 2 E 3 S o l lt T L 4 2 J d lap thresh I Single tap I Single tap Time z I c o 1 FrL
113. eed 122 Hz dimensions In the two dimensional X Y plane it determines whether the s device orientation is portrait up or portrait down and landscape right or Configuration Start on landscape left PU PD LR and LL respectively In the third z axis registers page 98 dimension the application detects whether the device is facing front or E k Status Start on facing back registers page 102 The PL application uses outputs from the Tilt application APP_ID 0x0B to determine the position of the device This application assumes a specific mounting of the MMA955xL platform on a board The meanings of up down front and back can change with the device s mounting on the board The following figure shows PL orientations in the X Y plane Y oi Landscape_angle Y PU Y Portrait angle X S lt hysteresis area Y Figure 9 1 Portrait and landscape detection in the X Y plane The preceding figure shows the axes at which the landscape and portrait positions are detected and the polarities of those positions The angles of the axes are configurable The region between the landscape and portrait axes is the hysteresis area where the previous state remains reported until the second axis is crossed MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 95 Portrait Landscape Application The PL application determines the positi
114. ent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 13 About This Document MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 14 Freescale Semiconductor Inc Chapter 2 Introduction The MMAO955xL low g 3 axis accelerometer is a member of Freescale s Xtrinsic family of intelligent sensor platforms The device incorporates dedicated accelerometer MEMS transducers signal conditioning data conversion a 32 bit programmable microcontroller and flexible communications and I O pins This unique blend of capabilities transforms the MMA955xL platform into an intelligent high precision motion sensing platform able to manage multiple sensor inputs and make the system level decisions required for sophisticated applications such as gesture recognition and pedometer tasks The MMA955xL platform can be further programmed and configured with the CodeWarrior Development Studio software C C and ColdFire assembly programming languages are supported For more information see References on page 13 This Eclipse based integrated design environment enables users to quickly and easily shape and implement custom algorithms and features to exactly match their project needs The MMA955xL platform can be used in conjunction with a host processor in any system that requires data acquisition and processing in response to motion of the entire system The host processor runs the
115. ers Mailbox e tnbsr Description Byte 4 Device identifier 31 24 5 Device identifier 24 16 6 Device identifier 15 8 7 Device identifier 7 0 8 ROM major version number 7 0 9 ROM minor version number 7 0 10 Firmware major version number 7 0 11 Firmware minor version number 7 0 12 Hardware major version number 7 0 13 Hardware minor version number 7 0 14 Build major version number 7 0 15 Build minor version number 7 0 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc Version Application The following table describes the Build Major and Build Minor version number fields Table 3 2 Version application Build major and minor bytes Byte Address Description Bit fields 3 Ox1FD Build major version number Range 110 3 Range 0 to 7 7 3 Build s day of the month 2 0 Year of build from 2010 7 Release 1 Engineering version 0 Production release 6 4 Build number 3 0 Month of build Range 1 to 12 4 Ox1FC Build minor version number 3 1 Reading the version information To read the MMA955xL platform s version information send the following command packets to the mailboxes 1 MBO Set APP ID to 0x00 2 MB1 Command to 0x00 Reads version information 3 MB2 Set offset to zero 0x00 Starts reading at offset 0 4 MB3 Set count field to Ox0C Reads12 bytes of data Byt
116. es to Send 0x00 0x00 0x00 0x0C The expected response to these commands is given in the following example Example 3 1 00 B4 B8 Bl Bl Bl B0 Bl B2 B3 80 OC OC 2F 33 48 B8 01 01 02 02 01 06 03 41 00 APP_ID 0x00 STATUS 0x80 Command Complete no errors RequestedData count 0xC Actual Data Count 0xC 7 Device ID 0x2F3348B8 9 ROM Version 01 01 0 11 Firmware Version 02 02 2 13 Hardware Version 01 06 4 15 Firmware Build 03 41 Production 3 4 Mar 2011 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 32 Freescale Semiconductor Inc Chapter 4 Scheduler Application A simple task scheduler manages execution of the applications of the Application 0x01 MMAOS5S5xL platform Based on a run to completion scheme the scheduler p X features very low cycle and memory overhead Default d Runs all the The scheduler is tightly coupled with the Analog Front End s sampling rate 9 ut spee time and is triggered at the start of every sample interval The system is designed f such that all applications must complete their processing within the sample coniguralion anon PP P P g P registers page 42 interval The scheduler handles both Freescale and licati tina pde e scheduler handles both Freescale and user applications registers page 42 A priority scheme allows short duration high priority tasks such as dat
117. escale Semiconductor Inc Reset Suspend Clear Control Applicat Table 18 2 Reset bit descriptions ion Field Description Reserved 31 30 Not used User application These are bits to use to reset user applications assigned to the following APP IDs 29 24 Ox1D 0x1C Ox1B Ox1A 0x19 and 0x18 0 Normal Operation 1 Initiates the reset sequence if the user application Reset Suspend Clear 0 Normal operation 23 1 Initiates the reset sequence of the Reset Suspend Clear application User application 22 19 These are bits to use to reset user applications assigned to APP IDs 0x16 0x15 0x14 and 0x13 0 Normal Operation 1 Initiates the reset sequence if the user application Auto Wake Sleep 18 0 Disables the reset sequence of the Auto Wake Sleep application 1 Initiates the reset sequence of the Auto Wake Sleep application Reserved Not used 17 Event FIFO 0 Disables the reset sequence of the Event Queue application 16 1 Initiates the reset sequence of the Event Queue application Data FIFO 0 Normal operation 15 1 Initiates the reset sequence of the Data FIFO application Frame Counter 0 Disables the reset sequence of the Frame Counter application 14 1 Initiates the reset sequence of the Frame Counter application User Application These are bits to use to reset user applications assigned to APP IDs 0x0D and O
118. escriptions Field Description Quad Change Configures the event that will be pushed into the Event Queue Application Currently there is one event available If enabled the application will push the new quadrant byte into the Event Queue every time the quadrant information changes Range of valid values 0 to 1 0 Disables events being added to the Event Queue 1 Enables tilt events to be added to the Event Queue Reserved Bit field reserved MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 131 Tilt Application 12 3 Tilt status registers 12 3 1 tilt delta xz ang Table 12 8 tilt delta xz ang register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field ANGFLG XZANGLE 6 0 Reset 0 0x00 Table 12 9 tilt_delta_xz_ang bit descriptions Field Description ANGFLG Stores the angle flag that is set whenever the difference between the current angle and the last calculated angle is bigger than the Angle_thresh The computation uses an approximation of the atan formula gt within 1 of accuracy only Units Flag Range of valid values from 0 to 1 0 Delta angle is not above the threshold 1 Delta angle went above the threshold XZANGLE Stores the tilt angle of the X and Z axes Units Degrees Range of valid values 0 to 90 MMA955xL Intelligent Motion Sensing Platform Software Referenc
119. eset Suspend Clear Control application 18 1 1 Reset The reset bit when set schedules a reset for an application At the next system cycle the reset process is handled The reset bit is automatically cleared by the Scheduler Application When the reset bit for an application is set the following actions occur e The application s reset callback function is executed The reset function is part of an application and it typically resets the application s outputs and internal variables e The reset bit is cleared The scheduled application is executed 18 1 2 Suspend The suspend bit when set prevents the an application from executing while the suspend bit is set Setting or clearing the suspend flag is managed by the host through a command or by an application by the API functions For more information on the latter see API functions on page 195 To preserve data coherency in an application the suspend flag must be set before attempting to modify an application s configuration The bit then must be cleared after the configuration has been changed An application s reset callback function is executed when its suspend bit flag is set so such callbacks should be implemented in a way to manage reset and suspend conditions MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 177 Reset Suspend Clear Control Application 18 1 3 Clear The clear bit clears an
120. est priority executable task and returns to the SFD task without any context switch 7 Later the SFD task completes and returns to the scheduler via a trap call 10 11 The scheduler clears the SFD task started flag and pops the idle task context from the stack The scheduler must start the MTIMOV task so 1t pushes the idle task context back onto the stack clears the MTIMOV request_to_start flag sets its started flag and returns into the MTIMOV task Though it is not necessary to pop then push the idle task context this technique simplifies the scheduler logic reducing the required code size The MTIMOV task completes and returns to the scheduler The scheduler clears the MTIMOV task started flag pops the idle task context from the stack and returns to the idle task MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 40 Freescale Semiconductor Inc Scheduler Application 4 5 Error conditions In the event that an application does not complete before it is triggered again the first instance of the application runs to completion before the second instance starts If a third trigger occurs before the first instance of the application completes the application misses an instance and is marked in the timeout register By checking the timeout status register the user can determine which priority application was missed The corresponding bit of the timeout will be set in the timeout
121. et 0 0 0 0 0 1 1 0 Table 15 10 entry size bit description Field Description entry size Shows the size in bytes of each entry or record in the queue This value is six bytes fixed and is not user configurable Units Bytes Range of valid values Fixed to six MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 158 Freescale Semiconductor Inc Event Queue Application 15 3 3 queue status Table 15 11 queue status registers Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field on going push on going pop Reserved to flag ovf flag empty flag wmrk flag Reset Table 15 12 queue status bit descriptions Field Description on going push Indicates that a push operation is being executed Units Non dimensional Range of valid values 0 to 1 on going pop Indicates that a pop operation is being executed Units Non dimensional Range of valid values 0 to 1 Reserved Bit field reserved to flag Indicates when the Event Queue has not been read for the time configured by the queue TimeOut parameter once the overflow marker has been reached Units Non dimensional Range of valid values 0 to 1 ovf flag Indicates when the Event Queue is full and no more entries can be stored Units Non dimensional Range of valid values 0 to 1 empty flag Indicates when the Event Queue is empty
122. eters uint8 t u8appid The application s identifier Return void Pointer to the application data structure If memory was not previously reserved for the specific APP ID a NULL value is returned For details on the indices of the previous functions in the Freescale functions table see User Applications on page 197 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 195 Memory Allocation for User Applications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 196 Freescale Semiconductor Inc Chapter 21 User Applications 21 1 Application binding The MMA955xL platform contains a user flash memory section reserved for up to three user images User images contain an identification table and functions associated with a user application User applications can be executed by the scheduler in the Freescale firmware Freescale firmware provides a mechanism for downloading up to three user images and binding them into the primary image A user application must have the defined application table as a header as shown in Figure 21 1 on page 198 In addition to the main user function applications must also have associated callback functions for init reset and clear These three callback functions allow the scheduler as well as the host and other applications to control applications The init function should allocate and initiali
123. events Range of valid values 0 No low g AND OR events detected 1 A low g AND OR events detected LGZ Indicates the detection of low g signals on the Z axis Range of valid values 0 No low g event detected on the Z axis 1 A low g event detected on the Z axis LGY Indicates the detection of low g signals on the Y axis Range of valid values 0 No low g event detected on the Y axis 1 A low g event detected on the Y axis LGX Indicates the detection of low g signals on the X axis Range of valid values 0 No low g event detected on the X axis 1 A low g event detected on the X axis MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 115 AAA High g Low g Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 116 Freescale Semiconductor Inc Chapter 11 Tap Detection Application 11 4 Overview of Tap Detection application cium Ox0A This application detects a tap or a double tap event on any of the three Default d accelerometer axes X Y or Z The result is reported independently along Voi oe with the direction of the tap positive or negative Configuration Start on registers page 120 A tap is defined as an accelerometer movement that exceeds a user defined magnitude threshold for a time falling between a user specifi
124. evice There are 14 unused APP IDs available for future Freescale applications as well as user applications Table 2 1 Platform applications X z Access to these registers X z Preloaded Freescale application APP ID Configuration bride registers Status registers MMA9550L MMA9551L Version 0x00 X X X Always runs Scheduler 0x01 X X X X Always runs Communications 0x02 488 GPIO 0x03 X X X 488 Mailbox 0x04 X X 488 Reserved Do not use 0x05 Analog Front End 0x06 X X X X 488 Portrait Landscape 0x07 X X X 122 High g Detection 0x08 X X X 244 Low g Detection 0x09 X X X 244 Tap Detection 0x0A X X m X 488 Tilt 0x0B X X X 122 Available for user applications APP ID 0x0C and 0x0D Frame Counter OxOE X X X X 488 Data FIFO OxOF X X X X 488 Event Queue 0x10 X X X X 488 Status Register 0x11 X X X X 488 Sleep Wake 0x12 X X X X 488 Available for user applications APP ID 0x13 0x14 0x15 0x16 Reset Suspend Clear 0x17 X X X 488 MBOX Config 0x18 X X X 488 Available for user applications APP ID 0x 19 0x1A 0x1B 0x1C 0x1D Ox1E Ox1F MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 22 Freescale Semiconductor Inc Introduction 2 6 Registers summary A summary of all the configuration and status output registers for the Freescale
125. f entries in the Data FIFO entry size in bytes Ch APP_ID DFC1 Range of valid values 0 to available oxFFFF MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 148 Freescale Semiconductor Inc Data FIFO Application 14 6 2 Entry size Table 14 11 Entry size register Offset 0x02 Bit 7 6 5 4 3 2 1 0 Field Entry Size Reset 0x00 Table 14 12 FIFO config byte bit description Field Description Entry Size This byte shows the size in bytes of each entry that the data FIFO has stored that calculation based on its configuration Units Bytes Range of valid values 0 to 6 14 6 3 FIFO Status Table 14 13 FIFO_Status register Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field on going push on going pop Reserved ovf flag empty flag wmrk flag Reset 0x00 0x00 0x00 0 0 0 Table 14 14 FIFO Status bit descriptions Field Description fifo on going push Indicates that a push operation is being executed the FIFO receiving data from the application Units Non dimensional Range of valid values 0 to 1 0 A push is not being executed 1 A push is being executed fifo on going pop Indicates that a pop operation is being executed The FIFO is sending out data and it is being read Units Non dimensional Range of valid values 0 to 1 0 A pop operation is not being exec
126. fered by the FIFO Range of valid values 0 to OxFF MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 146 Freescale Semiconductor Inc Data FIFO Application 14 5 4 Watermark Table 14 7 Watermark registers Offset 0x08 MSB 0x09 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field Watermark Watermark Reset 0x00 0x00 Table 14 8 Watermark bit description Field Description Watermark Sets the count in bytes for the FIFO to set or clear the watermark flag Units Bytes Range of valid values 0 available RAM MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 147 Data FIFO Application 14 6 Data FIFO status registers 14 6 1 Records number Table 14 9 Records number register Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field Records Number Records Number Reset 0x00 0x00 Table 14 10 Records number bit description Field Description Records Number This word stores the current number of records in the FIFO buffer A record is the payload packet of data comprised of an APP ID and the actual data which could be one two four or six bytes long A record can be two three four or seven bytes long Units Number o
127. g at 488 Hz to limit the signal bandwidth to 100 Hz 6th Order Chebyshev Anti Aliasing Filter ILE qu T Magnitude dB 0 50 100 150 200 Frequency Hz Figure 8 2 Frequency response of Analog Front End anti aliasing filter MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 78 Freescale Semiconductor Inc Analog Front End Application The bandwidth of the anti aliasing filter depends on the sample rate at which the front end application is running The following table shows the variation of the filter bandwidth according to the sample rate 8 1 4 Table 8 1 Anti aliasing filter bandwidth for different sample rates Stage 0 anti aliasing Filter Stage 1 anti aliasing Filter Sample rate Bandwidth Hz Bandwidth Hz 488 28 100 50 244 17 50 25 122 07 25 12 5 61 04 12 5 6 25 31 52 6 25 3 125 15 26 3 125 1 562 7 63 1 562 0 781 3 81 0 781 0 390 Raw data The output of the sensor is a 16 bit signed value The sensor always uses all the bits for high accuracy Depending on the range setting either 2 4 or 8 g mode the output value per g changes The following table shows the full scale value at the different g ranges as well as the value of a measured 1g acceleration at the different g ranges 8 1 5 Table 8 2 Raw accelerometer output according to g mode Normalization Range Full scale NE LUE 2g
128. g transaction to the High g Low g application 1 MBO 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 OxE8 7 MB3 Send Data 0x08 Specifies 33 ms 8 MB3 Send Data 0x17 Bytes to Send 0x09 0x20 0x00 0x04 0x03 OxE8 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 MBO 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 MBO APP ID 0x09 MB1 STATUS 0x80 Command Complete no errors MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 110 Freescale
129. gorithm reports a double tap event instead of two separate taps For more information see MMA8450Q Single Double and Directional Tap Detection Application Note AN3919 The double_tap_min_time time determines how quickly the second tap must occur to qualify as a double tap event MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 119 Tap Detection Application 11 2 Tap Detection configuration registers 11 2 1 tap thresh Table 11 1 tap thresh registers Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field tap_thresh tap_thresh Reset 0x0B 0x0B Table 11 2 tap_thresh bit description Field Description tap_thresh Sets the minimum magnitude that the signal must reach to be detected as a tap double tap event 7 0 Units ADC Counts 1 ADC count 244 ug Range of valid values 32 767 to 32 767 that is 8g Reset value OxOBOB decimal 2827 or about 0 69g 11 2 2 tap on min Table 11 3 tap on min register Offset 0x02 Bit 7 6 5 4 3 2 1 0 Field tap on min Reset Ox0A Table 11 4 tap_on_min bit description Field Description tap_on_min Sets the minimum time that the signal must remain above the threshold to be considered a tap event 7 0 Units Algorithm cycles Time Algorithm cycles 1 SRz
130. he X Z and Y Z tilt angle outputs relative to the fixed ground reference plane MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 127 Tilt Application rotation Direction of Figure 12 2 X Z and Y Z tilt angle outputs relative to fixed ground The following table shows the quadrant definition for planes X Z and Y Z depending on the sign of the axis signals Table 12 1 X Z and Y Z quadrant definitions Quadrant X Y acceleration Z acceleration 1 2 3 4 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 128 Freescale Semiconductor Inc Tilt Application 12 2 Tilt configuration registers 12 2 1 tilt K LP Table 12 2 tilt K LP register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field tilt K LP Reset 0 0 0 0 0 1 0 1 Table 12 3 tilt K LP bit description Field Description tilt K LP This element and the sample rate define the bandwidth of the low pass filter For the relationship between the K constant and the cut off frequency see Table 4 5 on page 43 and Table 4 10 on page 51 The cutoff frequency is given at 3 dB Units None Range of valid values 0 to 7 Reset Values to 0x05g MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 129
131. he host registers page 148 continues reading data until a maximum of up to 255 bytes is read per host request The host must read all the data that it requested The FIFO can be connected to one application and can collect packets of data in different sizes one two four or six bytes The Data FIFO has two different modes of operation Stop on Overflow and Free Run The application s status register displays current status values such as overflow condition watermark reached and buffer empty These conditions have a flag that is asserted individually each time one of these conditions occurs The user can configure the FIFO buffer size by writing to the fifo size word within the configuration registers The buffer size can be configured only once and is limited by the amount of RAM available The amount of available RAM can be impacted by the Event Queue Application which also can be configured to use large amounts of RAM NOTE Before configuring the Data FIFO application it is recommended that the Data FIFO Application be suspended After the parameter is configured remove the application from suspend A suspend is done with the Reset Suspend Clear Application APP ID 0x17 14 2 Modes of operation This section examines the modes of operation of the FIFO buffer 14 2 14 Stop on overflow The FIFO stores data from an application every single frame a scheduler interval as long as the FIFO is enabled In this
132. hese registers bits are shown in the following table Table 8 16 output FRONTEND Stage 1 XYZ registers Offset 0x06 MSB 0x07 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_1 X output FRONTEND_ Stage 1 X Reset 0x00 0x00 Offset 0x08 MSB 0x09 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND_Stage_1 Y output FRONTEND_ Stage 1 Y Reset 0x00 0x00 Offset OxOA MSB OxOB LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field output FRONTEND Stage 1 Z output FRONTEND Stage 1 Z Reset 0x00 0x00 Table 8 17 output FRONTEND Stage 1 XYZ bit description Field Description output Normalized accelerometer data sampled at the default rate of 244 Hz with a 50 Hz bandwidth FRONTEND Stage 1 Units 0 244 mg LSB XYZ Range of valid values 32 768 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 88 Freescale Semiconductor Inc Analog Front End Application 8 3 3 output FRONTEND Stage 0 ABSI XYZ These registers bits are shown in the following table Table 8 18 output FRONTEND Stage 0 ABS XYZ registers Offset 0x0C MSB OxOD LSB et X ie a p Be eee us uve sg als AO Field output FRONT
133. his enables the interrupt pin Bytes to Send 0x18 0x20 0x00 0x01 0x80 E E 19 3 Legacy mode In Legacy mode the lower address mailboxes operate as described in the Normal mode in the command response communications model MB20 through MB31 however are used as Quick Read registers These registers are automatically updated at the end of each sample frame with the latest results from the chosen applications The Mailbox application determines what data will appear in the mailboxes The quick read output data is selected with the configuration of the Mailbox application For more detail see Mailbox Application on page 67 Quick Read registers enable the host to quickly and directly read a limited set of data directly from the MMA955xL platform without first having to issue a command and wait for the completion of the command processing This makes support easier for legacy systems that expect to read sensor data In Legacy mode MB20 to MB31 are reserved for mapping the Quick Read registers By default the Quick Read registers MB20 MB31 contain the following data MB20 21 Status 0 1 MB22 Event Queue status MB23 FIFO status MV24 25 AFE Frame Counter MB26 27 AFE Stage 0 X axis data MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 190 Freescale Semiconductor Inc MBOX Configuration Application MB28 29 AFE Stage 0 Y axis data MB30 31 AFE Stage 0 Z axis data
134. host application and the MMA955xL platform runs the embedded application that provides a data interface to acceleration data from the linear acceleration sensor 2 1 Functional overview A host processor communicates with the MMA955xL devices via C or SPI serial buses A program on the host sends the commands via either the I2C or SPI serial bus and the MMA955xL platform s Command Interpreter CI interprets and responds to those commands The platform has two CIs one ROM based and one flash based The most recent reset determines which memory space the device is in If the device is in ROM memory space it runs the ROM CI If the device is in flash memory and runs the flash CI The ROM based CI commands are simpler low level commands The flash based CI commands are higher level higher function commands The ROM CI commands are described in the MMA955xL Intelligent Motion Sensing Platform Hardware Reference Manual MMA955xLRM The FLASH CI commands are described in this document The MMA955xL device can also be configured and programmed to act as a bus master The device talks to secondary sensors such as pressure sensors magnetometers or gyroscopes through its master serial communication interface The MMA955xL platform s master serial port can operate in PC or SPI mode By offloading the secondary sensors algorithms to the MMA955xL s embedded microcontroller users can develop unique features for their products MMA955xL I
135. ice after a low power mode Direct the host to write to general reset suspend clear configuration bit Direct the host to write to an application reset suspend clear configuration bit MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 186 Freescale Semiconductor Inc Reset Suspend Clear Control Application 18 4 Reset Suspend Clear status registers There are no status registers 18 5 Reboot to ROM Cl from flash code In order to reboot to ROM Command Interpreter it is necessary to execute the reset callback function of the reset suspend clear application by setting the respective reset flag The complete command for this operation is Example 18 1 MBOXO 0x17 Application ID MBOX1 0x20 CONFIG W command MBOX2 0x01 Offset MBOX3 0x01 Number of bytes to write MBOX4 0x80 Data 18 6 Reboot to flash code from ROM CI The operation to reboot into flash code when the ROM Command Interpreter is running can be performed by sending a CI RESET command the mailbox settings for this command is Example 18 2 MBOXO 0x29 ROM Command for boot to flash MBOX1 0x00 Reserved MBOX2 OxFF CI_PWR MBOX3 OxFF CI PWR MBOX4 OxFF CI_PWR MBOX5 OxFF CI_PWR For details about the ROM CI commands see the MMA955xL Intelligent Motion Sensing Platform Hardware Reference Manual MMA955xLRM See References on page 13 MMA955xL I
136. iconductor Inc Introduction 2 3 Data flow The MMA955xL platform can act as a standalone local processing unit or more commonly be connected to a host processor The host processor configures and reads data from the MMA955xL platform The basic building blocks of the MMA955xL platforms are the MEMS sensor accelerometer the analog to digital converters signal conditioning and an embedded ColdFire V1 microprocessor The physical data path is relatively simple as shown in the following figure Scheduler Reset Susp Clr Sleep Wake MBOX config Status Register GPIO application application application application application application APP_ID 0x01 APP_ID 0x17 APP_ID 0x12 APP_ID 0x18 APP_ID 0x11 APP_ID 0x03 Always 488 Hz 488 Hz 488 Hz 488 Hz 488 Hz Analog Front End Data FIFO Communications configuration application application APP ID 0x06 APP_ID 0x0F APP_ID 0x02 488 Hz 488 Hz Mailbox 488 Hz application Frame internal counter EAE S APP ID 0x04 Sample rate APP ID 0x07 488 Hz 122 Hz Event Queue application High g Low g APP IDz0x10 application APP_ID 0x08 0x09 3 axis MEMS 244 Hz User Tap application 1 application APP_ID 0x0A 488 Hz Tilt application 3 application APP ID 0x1F APP_ID 0x0B 1 400 Hz 122 Hz Platform Note Arrows indicate the directions of the data flows Figure 2 2 Platform data flow Internal applications that process the sensor data run on the embedded ColdFire processor MMA955xL In
137. id values 0 to 3 00 One byte 01 Two bytes 10 Four bytes 11 Six bytes Mode Configures the FIFO mode Units Non dimensional Range of valid values 00 Free Run 01 Stop On Overflow MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 145 Data FIFO Application 14 5 2 FIFO size word Table 14 3 FIFO size word registers Offset 0x04 MSB 0x05 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field FIFO Size Word 1 FIFO Size Word 2 Reset 0x00 0x00 Table 14 4 FIFO size word bit description Field Description FIFO Size Word Reserves the maximum size in bytes that the FIFO can use This is limited by the available RAM Units Bytes Range of valid values 0 to available RAM 0x1C8 decimal 456 is the maximum amount of RAM that can be requested from the MMA955xL device The RAM is shared by multiple applications so be careful not to set the FIFO to use more memory than is physically available That will cause unknown and undesirable results 14 5 3 FIFO APP ID Table 14 5 FIFO Channel APP D register Offset 0x06 Bit 7 6 5 4 3 2 1 0 Field FIFO Ch APP ID Reset 0x00 Table 14 6 FIFO Channel APP D bit description Field Description FIFO Ch APP ID The APP ID of the application that supplied data to be buf
138. igent Motion Sensing Platform Software Reference Manual Rev 0 66 Freescale Semiconductor Inc Chapter 7 Mailbox Application 7 1 Overview of Mailbox application eee 0x04 The Mailbox MBOX application gathers output data from other applications and puts that data into the mailbox registers This enables users to customize and group up to 28 applications specific data bytes for quick Configuration Start on reads registers page 67 Default speed 488 Hz Normally the host may need to read the status and output data from many Status applications This requires multiple serial slave port transactions Using registers the mailbox application enables the host to read all necessary data in one serial IC or SPI transaction None The MBOX application provides a shortcut for the user to read different pieces of data from different applications by combining the data for reading in one PC or SPI read transaction The MBOX application is different than the hardware mailboxes used by the Communication Interface application The MBOX application combines selected data bytes from specific applications and loads them into the Communications Interface mailboxes In order to properly configure the system Communications Interface both the MBOX Configuration and Mailbox applications also must be properly configured The MBOX Configuration application controls how the mailboxes behave and the Mailbox applicat
139. igh g signal The HGOAE LGOAE bits allow the selection between the logical OR or AND of the low g high g X Y and Z signals The threshold registers are low g thresh high g thresh The values from these registers are used to determine if the raw data signal has met the conditions to be interpreted as a high g low g signal The following figure shows the region where the signal is interpreted as a low g and high g signal Full Scale X Y ZHigh g Region High g Threshold Positive No signal Region Low g Threshold acceleration X Y ZLow g Region DeL X Y ZLow gRegion Low g Threshold A e 3 i Negative No signal Region i High g Threshold acceleration X Y Z High g Region Full Scale Figure 10 3 Low g High g thresholds MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 107 High g Low g Application 10 2 High g Low g configuration registers 10 2 1 low_g_thresh Table 10 1 low_g_thresh registers Offset 0x00 MSB 0x01 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field low_g_thresh low_g_thresh Reset 0 Il Geille ee hee Mar Te ae ie SEM Aa Table 10 2 low_g_thresh bit description Field Description low g thresh A 16 bit element that indicates the low g
140. ion Application Reset 1 1 1 1 1 1 1 1 Offset 0x09 reset bits 23 16 Bit 23 22 21 20 19 18 17 16 Rst Susp Clr User User User User Auto Wake Status Event FIFO Field e ie Moke P Application Application Application Application Sleep Reset 0 1 1 1 1 1 1 1 Offset 0x10 reset bits 15 8 Bit 15 14 13 12 11 10 9 8 Data FIFO Frame User User Tilt Sensing Tap Detect LG HG Field MT RI Counter Application Application Reset 1 1 1 1 1 1 1 1 Offset LSB 0x11 reset bits 7 0 Bit 7 6 5 4 3 2 1 0 Field PL Frontend Reserved MBOX GPIO CI Scheduler General Susp Reset 1 1 1 1 1 1 1 1 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 184 Freescale Semiconductor Inc Reset Suspend Clear Control Applicat Table 18 6 Clear bit descriptions ion Field Description Reserved 31 30 Not used User application These are bits to use to reset user applications assigned to the following APP IDs 29 24 Ox1D 0x1C Ox1B Ox1A 0x19 and 0x18 0 Normal Operation 1 Initiates the reset sequence if the user application Reset Suspend Clear 0 Normal operation 23 1 Initiates the reset sequence of the Reset Suspend Clear application User application 22 19 These are bits to use to reset user applications assigned to APP IDs 0x16 0x15 0x14 and 0x13 0 Normal Operation 1 Initiates the reset sequence if the user applica
141. ion controls what is placed in the mailboxes 7 2 Mailbox configuration registers The Mailbox application s registers are described in the following table The registers bit descriptions are given in MBOX bit descriptions on page 72 Each response mailbox MB4 to MB31 has two associated configuration registers APP ID register and Byte ID register When the Mailbox application runs it copies the data at the Byte ID from the specified APP ID and puts that value in the associated mailbox Users can configure mailboxes 4 through 31 Mailboxes 20 through 31 have a special function in Legacy mode They are updated automatically in the Legacy Quick Read mode MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 67 Mailbox Application Table 7 1 MBOX registers Offset 0x00 0x01 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP_ID MBOX_4 Byte_ID MBOX_4 Reset 0x00 0x00 Offset 0x02 0x03 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 5 Byte ID MBOX 5 Reset 0x00 0x00 Offset 0x04 0x05 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 6 Byte ID MBOX 6 Reset 0x00 0x00 Offset 0x06 0x07 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID
142. ions under scheduler control The interrupt assignment registers connect applications to interrupt events The scheduler parameter registers assign activity levels and priorities to the applications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 42 Freescale Semiconductor Inc Scheduler Application 4 6 1 request to start register An application can be scheduled to run by setting the bit corresponding to the application s APP ID in the request to start register The scheduler manages starting applications depending on priority and activity User applications also may schedule other applications to run by setting the appropriate bit in the request to start register When an application finishes and returns the scheduler clears the corresponding bit in the request to start register The request to start register enables a user to trigger one or more applications via the slave port command or a direct write through from a user application When modifying this register the user must logically OR the current value with the new value with a read modify write access to prevent the erasure of the task waiting to be started Table 4 4 request to start register Offset 0x00 MSB 0x01 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field request to start 31 24 request to start 23 16 Reset 0x00 0x00 Offset 0x02 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5
143. is When the high g low g condition is detected logic starts incrementing a debounce counter If the signal is no longer detected as high g or low g and the counter did not reach the high g cnt min low g cnt min value the counter is cleared or decremented according to what is configured in the DBCNT bit of the configuration register The following figure shows the described behavior noU tex Countthreshold Debounce count value r o E High low g condition DBCNT 0 Count threshold mE b Debounce count value LGE HGE LL p c oe cc eos 7 I L 1 I x E DBCNT 1 High low g condition 7 1 1 I L I 1 L I ey et Count threshold 22 2 Debounce count value L L I mr n EMI Hen E ROM oS AA EUN E DONE LGE HGE Figure 10 2 DBCNT bit function MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 106 Freescale Semiconductor Inc High g Low g Application For the AND flag to be set the application must detect all the enabled axes as a low g signal or as a high g signal at the same time If this condition is not met the AND flag will remain cleared even when one or more single axis flags are set For the OR flag to be set the application must detect at least one of the enabled axes as a low g or h
144. ister MSB Offset 0x00 Bit 15 14 13 12 11 10 9 8 Command Data N A N A N A N A N A N A Field Complete Ready Reset Table 16 19 Status Register LSB Offset 0x01 Bit 7 6 5 4 3 2 1 0 Field Unassigned PL Z Tilt Unassigned PL PL Lockout LAPO BAFRO Reset The Status Register Application s default settings are configured to meet the needs of most users See the following table The Portrait Landscape Application output bits are mapped to the status bits For detailed information about the Portrait Landscape Application s outputs see Table 9 16 on page 102 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 167 Status Register Application Table 16 20 Status Register application s default settings Field Description Reports a Z tilt angle lockout i Range of valid values eg Ecko 0 Lockout condition has not been detected 1 Z tilt lockout trip angle has been exceeded Lockout has been detected Reports a new portrait landscape orientation event Range of valid values 000 Undefined The default power up state PL LAPO 001 Portrait up Device is standing vertically in the normal orientation 010 Portrait down Device is standing vertically in the inverted orientation 011 Landscape right Device is in the landscape mode to the right
145. le 10 8 high g thresh bit description Field Description high g thresh A 16 bit element that indicates the high g threshold Any signal above the high g threshold will be considered a high g signal This value applies to all three axes Units Gravity units 1 ADC count 244 ug Range of valid values 1 244 ug to 32 767 Ox7FFF for 8g 10 2 5 high g cnt min Table 10 9 high g cnt min register Offset 0x06 Bit 7 6 5 4 3 2 1 0 Field high g cnt min Reset 0 0 0 0 1 0 0 0 Table 10 10 high g cnt min bit description Field Description high g cnt min An eight bit element that configures the time that a signal must be kept above the high g threshold in order to be considered as a high g signal Units Algorithm cycles Time Algorithm cycles 1 SR aug Range of valid values 1 to 255 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 112 Freescale Semiconductor Inc High g Low g Application 10 2 6 high g cfg Table 10 11 high g cfg register Offset 0x07 Bit 7 6 5 4 3 2 1 0 Field Reserved DBCNT HGOAE HGZEE HGYEE HGXEE Reset 0x00 1 1 1 1 1 Table 10 12 high g cfg bit descriptions Field Description Reserved Bit field reserved DBCNT Determines if the debounce counter will be decremented or cleared Range of valid values from 0 to 1 0 Cle
146. lication Portrait Landscape 0 Disables the reset sequence of the portrait landscape application 7 1 Initiates the reset sequence of the portrait landscape application AFE 0 Disables the reset sequence of the front end application 6 1 Initiate the reset sequence of the front end application Reserved Reserved 5 Mailbox 0 Disables the reset sequence of the mailbox application 4 1 Initiates the reset sequence of the mailbox application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 185 Reset Suspend Clear Control Application Table 18 6 Clear bit descriptions continued Field Description GPIO 0 Disables the reset sequence of the GPIO application 3 1 Initiates the reset sequence of the GPIO application Command Interpreter 0 Disables the reset sequence of the command interpreter application 2 1 Initiates the reset sequence of the command interpreter application Scheduler 0 Disables the reset sequence of the scheduler application 1 1 Initiates the reset sequence of the scheduler application General Reset 0 Disables a system wide reset sequence of all MMA955xLapplications 0 e 1 Initiates a system wide reset sequence of all MMA955xLapplications Once an application has set a flag it can be reset by one of the following mechanisms e Execute a power on reset e Wake the dev
147. lit in the format shown in the preceding illustration MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 151 Event Queue Application If an application tries to push data into the Event Queue and there is not enough space to store it the Event Queue will ignore the attempt This will be transparent for the application since there is no communication between the application and the Event Queue 15 1 1 Modes of operation The Event Queue works only in one mode It stores data and stops when the end of the queue is reached and asserts an overflow flag The queue is not circular The application has a configurable watermark that asserts a flag when entries have reached the configured point 15 1 2 Reading process To read the Event Queue the host sends a read status command to the MMA955xL device calling the Event Queue application that stores the data within the queue into a buffer and returns the number of bytes read If the number of requested bytes is not a multiple of the entry size the pop routine ignores the extra bytes and tells the host how many effective bytes were popped To read data stored by the Event Queue application the host must send a Read Data command along with a specific offset value The following table shows the command for reading the data stored by the Event Queue Application Reading Event Queue example The following example shows how to configure
148. mation see Table 5 6 on page 61 Actual number of bytes Actual number of bytes read or written This block reports back the actual number of bytes that were read or written It is normally the same as the requested number of bytes but it will be reduced if the requested number of bytes plus the Byte Offset exceeds the number of bytes in the requested block s data structure Requested number of bytes Number of bytes requested to be read or written Read data The data that was read The following table describes the status or error code results returned in Mailbox 0x01 Table 5 6 Error Status codes returned in Mailbox 0x01 Error Code Name Description 0x00 MCI ERROR NONE Command completed with no errors Incorrect input parameter 0x04 MCI ERROR PARAM Error may be due to an incorrect application ID an incomplete command or an incorrect offset 0x19 MCI INVALID COUNT em when the command COUNT is greater than the output structure 0x1C MCI ERROR COMMAND Returned any time that the command interpreter does not recognize a command code Returned when the host sends a number of bytes with a wrong payload 0x21 MCI ERROR INVALID LENGTH MMA955xL checks any mismatches between the amount of bytes received and the actual payload sent by the host 0x22 MCI ERROR FIFO BUSY FIFO is busy performing a push operation and it is not possible to execute any other function Returned when
149. me movement but not enough to change to Run mode The long time sample rate is used when the Sleep Wake module detects no movement in the accelerometer The application enters Doze mode when the Sleep Wake module detects no movement in the accelerometer for a specified period of time The amount of time is configured in the doze_thresh register 17 1 3 Sleep mode In Sleep mode the MMA955xL device does nothing and remains in the lowest power mode The device can enter this mode only when the user sets the SNCEN bit from the cfg configuration register or when the application starts Since the SNCEN bit is set by default the application starts in Sleep mode To exit the Sleep mode the user must clear the SNCEN bit from the efg configuration register This is done by issuing the corresponding write configuration command through the slave communications interface If the sensor is being used as a standalone without a slave communication interface the user must overwrite the default configuration to have the sensor start in the Run mode To overwrite the default MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 170 Freescale Semiconductor Inc Sleep Wake Application configuration a user application must be added Since each task must have an initialization function the user must add the write instruction of the cfg register to change the sensor from Sleep to Run mode This configuration can only be done
150. mperature Low Pass Filter Cutoff Coefficient 0x0B 8 EIC Low Pass Filter Cutoff Coefficient 0x0C 8 Sample Rate Configuration Address Width bits Register Name 0x00 0x05 48 Stage 0 XYZ 16 bits each for X Y and Z 0x06 Ox0B 48 Stage 1 XYZ 16 bits each for X Y and Z Ox0C 0x11 48 Stage 0 ABS XYZ 16 bits each for X Y and Z 0x12 0x17 48 Stage 0 RAW XYZ 16 bits each for X Y and Status 2 0x18 Ox1D 48 Stage 0 LPF XYZ 16 bits each for X Y and Z Ox1E 0x23 48 Stage 0 HPF XYZ 16 bits each for X Y and Z 0x24 0x25 16 Output Temperature 0x26 0x27 16 Output EIC 0x29 0x29 16 Frame Counter 1 Shaded rows indicate the compressed registers MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 26 Freescale Semiconductor Inc Table 2 2 Freescale provided applications registers continued i Introduction Portrait Landscape application APP ID z 0x07 Address Width bits Register Name 0x00 8 Threshold tilt 0x01 8 Landscape angle 0x02 8 Portrait angle Configuration 0x03 8 Debounce count 0x04 8 Hysteresis LO 0x05 8 Hysteresis BAFRO Back to Front 0x06 8 Configuration Address Width bits Register Name Status 0x00 8 PL OUT High g Low g application High g APP ID 0x08 Low g APP ID 0x09 Address Width bits Register Name 0x00 0x01 16 Low g
151. n Data FIFO 0 Normal operation 15 1 Initiates the reset sequence of the Data FIFO application Frame Counter 0 Disables the reset sequence of the Frame Counter application 14 1 Initiates the reset sequence of the Frame Counter application User Application These are bits to use to reset user applications assigned to APP IDs 0x0D and Ox0C 11 13 12 0 Normal operation 1 Initiates the reset sequence if the user application Tilt Sensing 0 Disables the reset sequence of the Tilt Sensing application 1 Initiates the reset sequence of the Tilt Sensing application Tap Detection 0 Disables the reset sequence of the Tap Detection application 10 1 Initiates the reset sequence of the Tap Detection application Low g Detection 0 Disables the reset sequence of the Low g detection application 9 e 1 Initiates the reset sequence of the Low g detection application High g Detection 0 Disables the reset sequence of the High g detection application 8 1 Initiates the reset sequence of the High g detection application Portrait Landscape 0 Disables the reset sequence of the portrait landscape application 7 1 Initiates the reset sequence of the portrait landscape application AFE 0 Disables the reset sequence of the front end application 6 1 Initiate the reset sequence of the front end application Reserved Reserved 5 Mailbox 0 Disables
152. n contains more than one data byte the internal destination mailbox address is automatically incremented so that the incoming byte is placed in the next mailbox For mailbox addresses greater than 31 bytes or for transactions where the mailbox address auto increments past mailbox 31 the destination address wraps back to the start of the mailbox addresses MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 55 Communication Interface 5 2 1 Mailbox timing diagrams d J n AUAM UII JI I AAA UA A A 7 E Data I yae K X9 C W 9C O10 s Start Q Acknowledge C Stop Figure 5 2 I C timing diagram Enable m MISO 1 Ad I E MISO SPI Master In Slave Out MOSI SPI Master Out Slave In SPI Serial Peripheral Interface Figure 5 3 SPI timing diagram 5 3 Mailbox usage Commands to the MMA955xL platform consist of a write followed by one or more reads It may take some time to complete the command and a flag can be checked to determine if the command has completed That flag is the Command Complete COCO bit the seventh bit of the read data in the second mailbox See Table 5 4 on page 60 On a read operation the COCO bit indicates if the command has been processed The host processor can determine the status of the command s processing by repeatedly reading or polling the second mailbox until the COCO
153. ndicates that writing a 1 to this bit field clears it Write wic Read 0 Indicates a self clearing bit Write FIELDNAME MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 12 Freescale Semiconductor Inc About This Document 1 5 References 1 MMA955xL Intelligent Motion Sensing Platform documentation MMA955xL Product Documentation Page 2 IEEE Standard Test Access Port and Boundary Scan Architecture IEEE Std 1149 17M 2001 R2008 3 The I C Bus Specification Version 2 1 January 2000 Philips Semiconductors 4 PC Bus Specification and User Manual NXP Semiconductors Document UM10204 Rev 03 19 June 2007 5 ColdFire Family Programmer s Reference Manual Freescale Semiconductor CFPRM Rev 3 03 2005 6 Wikipedia entry for Semaphore http en wikipedia org wiki Semaphore programming 7 ITU T V41 Recommendation Code Independent Error Control System available at http www itu int publications index html 8 ITU T X 25 Recommendation Interface between Data Terminal Equipment DTE and Data Circuit terminating Equipment DCE for terminals operating in the packet mode and connected to public data networks by dedicated circuit available at http www itu int publications index html 9 ITU T T 30 Recommendation Procedures for document facsimile transmission in the general switched telephone network available at http www itu int publications index html MMA955xL Intellig
154. ntelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 15 Introduction The MMA955xL platform has Freescale provided pre programmed applications and infrastructure modules such as a scheduler filters command interpreter basic accelerometer gesture recognition and pedometery In addition users can write their own custom applications adding to the software applications and infrastructure of the MMA955xL platform This document describes the functionality configuration and outputs of all the Freescale provided applications 2 2 MMA955xL package axis orientation The package orientation and measured values are shown in the following figure PU Portrait Up PD Portrait Down LL Landscape Left LR Landscape Right Back Back facing up Front Front facing up In the Portrait Up orientation both X and Z axes read Og and the Y axis reads the equivalent of 1g Top view Portrait up Pin 1 gt D Earth gravity c Side view Landscape left Landscape right Xout 0g Yout 1g s Pack Zout e ud p M NY Xout 0g Yout 9 0g 2 Zout 1g Portrait down Xout 1g Xout 1g Yout 0g Yout 0g Front Zout 0g Zout 0g c lA Ji m o Xout 9 0g Yout 9 0g e Zout 1g Xout 0g Yout 1g Zout 0g Figure 2 1 Device orientation MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 16 Freescale Sem
155. ntelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 187 AAA AA Reset Suspend Clear Control Application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 188 Freescale Semiconductor Inc Chapter 19 MBOX Configuration Application 19 1 Overview of MBOX Configuration application The MBOX Configuration application works with the Mailbox application Chapter 7 Mailbox Application on page 67 and the Communications application Chapter 5 Communication Interface on page 55 to provide data back to the host in a way that the host can best use the data The MBOX Configuration application configures how the mailboxes behave The Mailbox application configures what data is stored in the mailboxes Application 0x18 ID Default speed Always available Configuration page 191 registers Status None registers By default the MMA955xL operates in the Commands Response mode where a host must issue a write command followed by one or more reads to get data The MMA955xL can also be put into a Legacy mode where the host just issues a read command to get data The mailboxes can be accessed in either of two modes Normal or Legacy The mailboxes default mode is Normal but the mode can be changed through this the mailbox configuration application APP_ID 0x18 The following figure shows the differences between
156. ntelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 43 Scheduler Application software triggered applications Be advised however that there are no protections to prevent a slave port command or a direct write from triggering a hardware assigned applications such as SFD or MTIMOV Regardless of which mechanism triggers the Scheduler application to start a hardware interrupt a slave port command or a trap interrupt it always executes the highest priority applications first As a result a slave port command could trigger a low priority application but some time may occur before that application actually executes 4 6 2 request to start register configuration example To configure the request to start register send this command read the register and modify it and write it back Example 4 3 1 MBO Set the Scheduler application identifier 0x01 2 MBI Set the Command Read Config application identifier 0x10 3 MB2 Set the Offset to Zero field 0x00 to point to the request to start configuration register 4 MB3 Set the Count field 0x04 to request four bytes Bytes to send 0x01 0x10 0x00 0x04 5 Read back the mailboxes The current value of the request to start register is stored in MB4 MB7 Modify the value as needed 6 7 MBO 8 MBI 9 MB2 10 MB3 11 MB4 12 MB4 13 MB4 14 MB4 Set the Scheduler application identifier 0x01 Set th
157. on y ee registers page 156 The size of the Event Queue is limited by the available RAM The amount of RAM may be reduced by the Data FIFO Application which also can be Status Start on configured to use the RAM registers page 158 Some applications inside the MMA955xL platform have an eight bit event mask register within configuration registers structure that selects the specific event to be stored into the Event Queue The user can set an application s event mask bit to enable or prevent that application s events from being added to the Event Queue When the selected event happens Event Queue Application calls a routine with the following prototype to push the application s event into the Event Queue void eventQueue push void data uint8 t size With these variables e Data Pointer to the first element of the data to be stored into the queue The data must have the order APP ID Payload bytes Size Amount of data in bytes to be stored into the queue Each entry into the Event Queue is of fixed size and has the following format Frame Counter Payload Six bytes per entry Figure 15 1 Entry format for the Event Queue If an application has its payload less than three bytes the Event Queue will store the data and complete the entry padding with zeros If the application has a payload more than three bytes the Event Queue will calculate the number of entries that this payload needs to be successfully stored sp
158. on 8 1 Overview of Analog Front End application 002 cece ee 77 ml SA IS 4 100999 39 cr AO AAA dl d OR ER OX 78 8 1 2 Offset and scale correction 000 cece eee 78 813 AMPA TES access cocucudas eres beestnentuneds sates obependecz 78 Ue RN Cale ees co hidags core A 79 SLE Ta 413 32 94 eons Ee ir Oe Rode CERE ee dee tare n RE e e ede 79 8 1 6 Down sampling and stage 1 anti aliasing filler 80 ELI APSO ie ad is e addc ERR Ee a ee dx 80 8 1 8 Configurable low pass and high pass filters ooooo oo 80 8 2 AFE configuration registers 0 0 es 83 Oe SS uousasstebunhedA ix qned Maas dea ae AE daa aude a dde bd d dba 83 mec Qu COU ua qao d gp dog ko ded on AGAR 84 A NE A A T E E E TET 85 EA ed eS a EO REET oR OR ae ee Bees 86 Bg re Sy SCS ciar ck be teresa teedause bees 87 8 3 1 mUDUIFBONTEND Stage OIIAYZ uauauuu cu irc Rx Ren m RR Ret n 87 8 3 2 output FRONTEND Stage 1 XYZ 0 20022 eee 88 8 3 3 output FRONTEND_Stage_0_ABS XYZ ick ccesviaecaceeeennn anc 89 8 3 4 output FRONTEND_Stage_0_GM XYZ 44th ee VE donar CN eR 90 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 4 Freescale Semiconductor Inc Section Number Title Page 8 3 5 output FRONTEND Stage 0 LPFEXYZ ia suen ncusuza a ken hn RR n Ra 91 8 3 6 UpulFHONTEND Stage 0 MPFEEEYZ iua ca CI Re RC CER RR A 92 EG BUBD DEUM a opina p qr Wa adonde d hae dr deed 93
159. on by comparing the X Y angle obtained from the tilt application with landscape and portrait configured angles The application uses the quadrant value to select direction up or down for portrait or right or left for landscape The following figure shows the package orientation and measured values reported by the tilt application In the Portrait Up orientation both X and Z axes read Og and the Y axis reads back the equivalent of 1g Top view Portrait Up Pin1 D Earth gravity Side view Landscape Left WET Landscape Right out g Yout 1g s Back Zout 0g DA Ww Xout 0g Yout 0g Zout 1g Portrait Down Xout 1g Xout 1g Yout 0g Yout 0g Front Zout 0g ye Zout 0g lt a a ee to Xout 0g Yout 9 0g Zout Q 1g Xout 0g Yout Q 1g Zout 0g Figure 9 2 Sensing direction and output response MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 96 Freescale Semiconductor Inc Portrait Landscape Application Portrait Portrait 90 90 Landscape to Portrait Trip angle 60 Portrait to Landscape Trip angle 30 0 Landscape 0 Landscape Non Lockout 0 o Lockout Trip angle 30 90 Lockout Figure 9 3 Angles for portrait and landscape detection The 3D detection for back or front is done using the sign of the z axis The PL application returns positive Z for the back orientation and a negative z for front orientation
160. output EIC Output of the external analog input conversion value Units 3 472 mV LSB Range of valid values 32 768 to 32 767 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 93 Analog Front End Application 8 3 9 frame counter This register s bits are shown in the following table The frame counter register also can be read with the Frame Counter application See Chapter 13 Frame Counter Application on page 135 Table 8 30 frame counter registers Offset 0x28 MSB Ox29 LSB Bit 7 6 5 4 3 4 3 2 1 0 Field frame counter frame counter Reset 0x00 0x00 Table 8 31 output EIC bit description Field frame counter account The frame counter will restart at zero when it reaches 65 535 Units Non dimensional Range of valid values 0 to 65 535 Provides the number of frames that have been processed at the configured sample rate It is not a real time representative because the time that the device remains in the stop mode is not taken into MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 94 Freescale Semiconductor Inc Chapter 9 Portrait Landscape Application 9 1 Overview of Portrait Landscape application 7PP cetion 0x07 The Portrait Landscape PL application detects positions in two and three Default sp
161. plication 0x01 Status application LSB Offset 0x24 0x25 Bit 7 6 5 4 3 2 1 6 5 4 3 2 1 Field APP ID MBOX 22 Byte ID MBOX 22 Reset 0x10 Defaults to Event Queue application 0x03 Event Queue Status Offset 0x26 0x27 Bt 7 6 5 4 1 3 2 1 6 5 4 38 2 1 Field APP ID MBOX 23 Byte ID MBOX 23 Reset OxOF Defaults to Data FIFO application 0x03 FIFO status MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 70 Freescale Semiconductor Inc Mailbox Application Table 7 1 MBOX registers continued Offset 0x28 0x29 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 24 Byte ID MBOX 24 Reset 0x06 Defaults to Analog Front End application 0x28 Analog Front End Frame Counter MSB Offset 0x2A 0x2B Bit 7 6 5 4 3 2 1 0 Z 6 5 4 3 2 1 0 Field APP ID MBOX 25 Byte ID MBOX 25 Reset 0x06 Defaults to Analog Front End application 0x29 Analog Front End Frame Counter LSB Offset 0x2C 0x2D Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 26 Byte ID MBOX 26 Reset 0x06 Default
162. r Piee tih Host decides the size E in bytes FIFO size HEC p r Entry Records WM OF Empty size number l flag Y flag flag aloe ol L Interrupt GPIO mapping logic I Figure 14 1 Data FIFO model The preceding figure shows the block level model of the data FIFO The application is driven by the watermark and mode inputs that configure the functionality The watermark level helps the host prevent data loss by raising a warning just before the overflow condition occurs When the number of bytes in the buffer approaches its capacity the data FIFO asserts the watermark flag in the status register The warning level is user configurable If the level of 0 is configured the watermark is disabled The channel has its own data format code DFC bit field that configures the payload to be stored one two four or six bytes A NULL or zero value in the APP ID Channel register means the channel is disabled Any valid APP ID value means the channel is enabled The data FIFO has a status register in its output structure that contains status flags such as watermark overflow and buffer empty These flags can be mapped to the GPIO pins to generate an interrupt to the host The output also has an Entry Size register that shows the size in bytes of each entry that the data FIFO calculated according to its payload configuration A Records Number register records the number of entries stored in the data FIFO Bo
163. r desk you can save power by not running applications like portrait landscape 4 3 Interrupts Interrupts immediately divert execution from any application or the idle state into dedicated interrupt handlers The scheduler is not invoked so the interrupt returns without redirection All interrupt handlers disable interrupts so application ready communication and pin interrupts divert execution only from applications or the idle state Interrupts are never nested User interrupt handlers should be made as small and as fast as possible The MMA955xL platform supports the interrupts listed in the following table Each supported interrupt can be associated with zero or more priorities When the interrupt occurs the scheduler triggers all the applications associated with the priorities configured for that interrupt The priorities for each interrupt are configured in the scheduler configuration parameter structure Table 4 2 Supported interrupts 1 Name Description SFD Start of Digital Frame interrupt This interrupt occurs when the start of frame signal is asserted COCO Conversion complete interrupt This interrupt occurs when the AFE cycle has completed and all ADC conversions are complete and ready to be used IRQ IRQ pin interrupt This interrupt occurs when the selected input pin detects the configured condition rising edge high level or falling edge low level TPMOV Timer overflow interrupt This inter
164. r the next lower priority level 6 When all priorities have been run the scheduler enters an idle state 4 2 Scheduler application elements MMAO955xL applications consist of the application code a set of specifically defined callback functions that the scheduler uses to control the application and a header structure that enables the scheduler to find the application and callback functions For the scheduler to find the applications at boot time they must be linked and located at specific addresses in the memory Users can implement up to three application tables Each application table can include multiple applications Applications are assigned a priority and an activity level These two parameters determine when the scheduler runs the application For more information on applications see User Applications on page 197 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 34 Freescale Semiconductor Inc Scheduler Application 4 2 1 Priority levels A priority scheme allows short duration high priority applications such as data sampling and filtering to preempt long duration low priority applications The scheduler supports 24 unique priorities from 0x00 to 0x17 0 to 23 in decimal The larger the number the higher the priority with such applications run before applications with lower numbers Multiple applications can be assigned the same priority level The priority level for ea
165. r the actual ending address of the software application SRAM see the release notes 3 These two buffers are allocated dynamically in the user s SRAM space The start and end address of each buffer depends on which one is allocated first Figure 20 1 RAM memory map MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 193 Memory Allocation for User Applications The distribution of the user RAM section will start from the end address of the software application SRAM section The actual starting address varies depending on which device in the MMA955xL family is being used The location of each user block Data FIFO buffer Event FIFO buffer and User Variables depends on the order that the memory blocks were requested The RAM memory is reserved in one direction which means that is not possible to free memory The user should avoid using static memory defined by a linker file If this approach is used care must be taken to not override memory allocated through the API calls The definition of the user data structure must start with the outputs followed immediately by the parameters without any padding in between and the private variables as is shown in the following example Example 20 1 typedef struct user filter struct tag struct user filter outs tag int16 xyz USER FILTER AXES uint8 counter outs struct user filter param tag uint8 max boundary
166. re assigned to an application in the Interrupt Assignment registers See Interrupt assignment registers on page 45 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 38 Freescale Semiconductor Inc Scheduler Application 4 4 Scheduler preemption This section gives some detailed examples of how preemption is handled by MMA955xL platforms 4 4 1 High priority task suspending low priority task The scheduler has the ability to switch to a higher priority application while a lower priority application is running This example examines a low priority counter application such as for a pedometer and a high priority data processing application that might be used for a special user task Example 4 1 Initially the user 1 Configures the timer interrupt to point to the counter application s APP ID in the user interrupt register of the scheduler 2 Sets the priority of the counter application in the sched parms register of the scheduler to something low 3 Sets the priority of the data processing application in the sched parms register of the scheduler to TASK488 or something higher than the counter application If the scheduler is in the idle state and all high and low priority applications have been run the scheduler has nothing left to do and is waiting for an interrupt In this example the hardware timer counter has just overflowed and triggered an interrupt In this scenario th
167. ree ey ee ora 199 21 3 Additonal TOSOUIESE nadar ri des cites dud vas 200 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 8 Freescale Semiconductor Inc Chapter 1 About This Document 1 1 Overview 1 1 1 Purpose This software reference manual describes the features architecture and programming model of the MMA 9550L MMA9551L and MMA9553L intelligent motion sensing platforms Additional information for the MMA9553L platform is available in the MMA9553L Intelligent Pedometer Platform Software Reference Manual MMA9553LSWRM See item in References on page 13 The MMA9559L platform is a member of the MMA955xL family that has the same hardware as the other platforms but significantly different firmware For that reason the MMA9559L platform is described in a separate software reference manual MMA9559LSWRM See item 1 in References on page 13 1 1 2 Audience This document is primarily for system architects and software application developers who are using or considering use of the MMA9550L MMA9551L and MMA9553L platforms in a system 1 2 Terms and acronyms AFE Analog Front End APP_ID Application Identifier API Application Programming Interface CC Command Complete CI Command Interpreter CMD Command COCO Conversion Complete DFC Data Format Code DTAP Double tap n FIFO First In First Out a data structure GPIO General Purpose Input Output a microcontroller pin tha
168. rupt occurs when the TPM counter resets to 0x00 after reaching the modulo value programmed in the TPM counter modulo register TPMCHO Timer channel 0 interrupt This interrupt occurs when the value in the TPM counter matches the value in the TPM channel 0 value register TPMCH 1 Timer channel 0 interrupt This interrupt occurs when the value in the TPM counter matches the value in the TPM channel 0 value register MTIMOV MTIM16 overflow flag This interrupt occurs when the MTIM16 counter overflows to 0x0000 after reaching the value in the MTIM16 modulo register PDBA Programmable delay block interrupt This interrupt occurs after the trigger source has activated the PDB counter and the counter has matched the PBD modulo value MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 37 Scheduler Application Table 4 2 Supported interrupts continued Name Description PDBB Programmable delay block interrupt This interrupt occurs after the trigger source has activated the PDB counter and the counter has matched the PBD modulo value MASTER I2C Inter Integrated Circuit interrupt This interrupt is linked to the I C master communication tasks 1 For more information see the MMA955xL Intelligent Motion Sensing Platform Hardware Reference Manual MMA955xLRM accessible from a link In References on page 13 Interrupts a
169. s A aC aed 1 05s O oria CREAR EE 2 1s s diii doeet E R 4 19s MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 173 Sleep Wake Application 17 2 4 short time off Table 17 7 short time off register Offset 0x05 Bit 7 6 5 4 3 2 1 0 Field Reserved short time off 3 0 Reset 0x00 0 1 1 0 Table 17 8 short time off bit description Field Description Reserved Bit field reserved short time off Configures the short time interval between AFE samples when the application is in Doze mode Units Time For more information see Section 10 3 High g Low g status register on page 115 Range of valid values 0 to 10 Long time valuesTime seconds Wo 4 1 ms P 8 19 ms D us gung wwe E x de 16 4 ms uo E 32 ms E Li duri dspavie i IRE D ded 65 5 ms OE PPM 131 ms dE IP 162 ms A a a T 524 ms 8 BL E E E E 1 05s E harass 2 1s AM P 4 19s MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 174 Freescale Semiconductor Inc Sleep Wake Application 17 2 5 cfg Table 17 9 cfg register Offset 0x06 Bit 7 6 4 3 2 1 0 Field Reserved Stop DIS IRQ_EN SCHEN FLEEN SNCEN Reset 0x00 0 0 0 0 1 Table 17 10 cfg bit descriptions Field Description Reserved Bit field reserved Stop_DIS Disables or
170. s of the accelerometer The application has three modes of operation Run Doze and Sleep 0x013 0x016 Available for user applications Application IDs that can be used for user applications 0x17 Reset suspend clear Controls the Reset Suspend Clear functions of the MMA955xL platform 0x18 Mailbox mode config Configures different operation modes of the mailbox and provides the status value of the mailbox when Stream mode is running 0x19 OX1F Available for user applications Application IDs that can be used for user applications 0x20 OxFF Reserved Indicates an invalid application index 1 Shaded rows indicate unused application identifiers available for user applications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 59 Communication Interface 5 3 3 Mailbox command format for a read Though all commands must be written in a single PC SPI transaction starting at Mailbox 0 the response can be read from any subset of the mailbox registers When the MMA955xL platform is configured to stream data as in FIFO mode the read commands must be constructed as multiples of 32 bytes in order to trigger the internal transfer of the next set of data to the mailboxes A read request command requires a write to the first four mailboxes The format of the information returned from the MMA955xL platform is shown in the following table
171. s to Analog Front End application 0x00 Analog Front End Stage 0 X MSB Offset Ox2E Ox2F Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 27 Byte ID MBOX 27 Reset 0x06 Defaults to Analog Front End application 0x01 Analog Front End Stage 0 X LSB Offset 0x30 0x31 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 28 Byte ID MBOX 28 Reset 0x06 Defaults to Analog Front End application 0x02 Analog Front End Stage 0 Y MSB Offset 0x32 0x33 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 29 Byte ID MBOX 29 Reset 0x04 Analog Front End Stage 0 Z MSB 0x03 Analog Front End Stage 0 Y LSB Offset 0x34 0x35 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field APP ID MBOX 30 Byte ID MBOX 30 Reset 0x06 Defaults to Analog Front End application 0x04 Analog Front End Stage 0 Z MSB MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 71 Mailbox Application Table 7 1 MBOX registers continued Offset 0x36 0x37 et lie eS a las de coe oe el aT eee ec ae ice Field APP ID MBOX 31 Byte ID MBOX 31 Reset 0x06 Defaults to Analog Front End application 0x05 Analog Front End Stage 0 ZLSB 7 2 1 MBOX bit descriptions Table 7 2 MBOX bit descriptions Field Description APP ID Specifies the application to provide the output byte using the application identifier MB
172. status register For more information on the timeout status register see Chapter 16 Status Register Application on page 161 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 41 Scheduler Application 4 6 Scheduler configuration registers The scheduler has the following three groups of configuration registers e gequest to start register interrupt assignment registers scheduler parameters registers The configuration and status registers are listed in the following table Table 4 3 Scheduler configuration and status registers Register type Address Width bits Register Name 0x00 0x03 32 Request to start 0x04 0x07 32 SFD Interrupt ApplDs 0x08 0x0B 32 AFE COCO Interrupt_AppIDs 0x0C 0x0F 32 IRQ Interrupt_AppIDs 0x10 0x13 32 TPMOV Interrupt_AppIDs 0x14 0x17 32 TPMCHO Interrupt_AppIDs 0x18 0x1B 32 TPMCH1 Interrupt ApplDs Configuration 0x1C 0x1F 32 MTIMOV Interrupt_AppIDs 0x20 0x23 32 PDBA Interrupt_AppIDs 0x24 0x27 32 PDBB Interrupt_AppIDs 0x28 0x2B 32 Master 12C Interrupt_AppIDs 0x2C 8 sched_parms_APP_ID_0x00 0x2D 0x4A 8 each sched_parms_APP_ID_0x01 through Ox1E 0x4B 8 sched parms APP ID Ox1F Address Width bits Register Name Status 0x00 0x03 32 Timeout Status 1 Shaded rows indicate the compressed registers The request to start register is a way to run the applicat
173. t can be programmed by software HG High g PC Inter integrated circuit LG Low g MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 9 About This Document LL Landscape left LR Landscape right MAC Multiply accumulate unit MBOX Mailbox MCU Microcontroller MEMS Microelectromechanical systems MISO SPI Master In Slave Out MOSI SPI Master Out Slave In MTIMOV Module Timer Overflow Module PD Portrait Down PDB Program Delay Block PL Portrait Landscape Platform A grouping of hardware and software working together PU Portrait Up SFD Start Frame Digital SPI Serial peripheral interface TPM Timer Program Module MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 10 Freescale Semiconductor Inc About This Document 1 3 Conventions This document uses the following notational conventions cleared set MNEMONICS mnemonics italics 0x0 0b REG FIELD nibble byte word longword X n OVERBAR When a bit takes the value 0 it is said to be cleared when it takes a value of 1 it is said to be set In text instruction mnemonics are shown in uppercase In code and tables instruction mnemonics are shown in lowercase Italics indicate variable command parameters Book titles also are italicized The Ox prefix to denote a hexadecimal number The b suffix to denote a binary number Abbreviations for registers are shown in upper
174. ta FIFO Application Bytes to Send Ox0F 0x30 0x03 0x18 The response is below OF 80 18 18 05 33 53 06 00 93 00 7F 11 06 06 00 A2 00 7D 11 08 06 00 9C 00 79 11 07 The last six bytes are the AFE data X Y and Z This response was with the device flat in the Face Up orientation The X and Y data are close to 0x0000 or 0 g and the Z data is close to 0x1000 or 1 g MBO APP ID 0x0F FIFO application MBI STATUS 0x80 Command Complete no errors MB2 Requested data count 0x18 24 bytes of data MB3 Actual Data Count 0x18 24 bytes of data MBA 0x05 FIFO Status Watermark and Overflow flag is set MB5 6 0x3353 Timestamp MB7 APP ID of the application providing the actual data 0x06 The AFE application MB8 9 AFE X data 0x0093 MB10 11 AFE Y data 0x007F MB12 13 AFE Z Data 0x1106 MB 14 APP ID of the application providing the actual data 0x06 the AFE application MB15 16 AFE X data Ox00A 1 MB17 18 AFE Y data 0x007D MB19 20 AFE Z Data 0x1108 MB21 APP ID of the application providing the actual data 2 0x06 the AFE application MB22 23 AFE X data 0x009C MB24 25 AFE Y data 0x0079 MB26 27 AFE Z Data 0x1107 To read data stored by the data FIFO application the host must send a Read Data command along with a specific offset value This process has three conditions e The offset must be fixed to three The number of bytes to read must be larger than one and a multiple of the entry size
175. telligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 17 Introduction The functional flow of the MMA955xL platform includes the following A mechanical acceleration event causes a small mass to move inside the MEMS sensor 2 The motion or offset is converted to a small voltage and amplified 3 The analog to digital converter samples the voltage and converts it to a digital number Those digital numbers are available for the embedded ColdFire processor to read and process 4 Freescale provided applications running on the ColdFire processor process the data and provide high level analysis such as angle position and gesture recognition 5 If desired user applications implement extended or new functions and features 6 If desired and programmed the MMA955xL platform interrupts the host processor on specific conditions 7 Ifdesired and programmed the host processor polls or responds to the MMA955xL interrupts and collects the processed information from the MMA955xL platform 2 4 User applications User applications are a collection of functions grouped with a header structure Such applications consist of A header structure for the scheduler to find the application and callback functions Asetofcallback functions for the scheduler to control the user application e The application code The header structure is called an application table This table is a structure that contains the t
176. tes the Quick Read registers QR whether the slave port is active or inactive 01 Mode 1 Updates the QR registers only if the slave port is inactive If the slave port is active the update takes no action and waits until the slave port is inactive 10 Mode 2 Updates the QR registers if the slave port is inactive If the slave port is active 12C transactions are running this mode will enable a receive interrupt in the slave port to be triggered immediately after the transaction ends After this the QR register is immediately updated and the receive interrupt disabled 1 0 Reserved MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 192 Freescale Semiconductor Inc Chapter 20 Memory Allocation for User Applications 20 1 Overview of memory allocation User applications can allocate their data variables such as status outputs configuration inputs and private variables The RAM memory distribution of the MMA955xL device is divided in four sections Firmware SRAM User SRAM Data FIFO Event FIFO and user application data User stack Supervisor stack The memory distribution is shown in the following figure 0x800000 Software application SRAM Note 1 ai d EPPP PTP PPP PrP PPS PPP Fer FFP T Data FIFO 2 ayant FIFO E RAUM buffer i buffer ii PP E Customer i AR SRAM 0x800680 A r User stack 0x800740 L Supervisor stack 0x800800 2 Fo
177. th registers help the host to calculate how many bytes to request so that it can dump the entire FIFO buffer A simple multiplication of those two registers value gives the total number of bytes stored in the FIFO MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 143 Data FIFO Application 14 4 1 Entries format Channel enabled Size defined by DFC1 1 2 4 or 6 bytes Entry 1 APP_ID 1 byte Payload N bytes Entry 2 APP_ID 1 byte Payload N bytes APP_ID 1 byte Payload N bytes Figure 14 2 FIFO entry formats when channel enabled MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 144 Freescale Semiconductor Inc Data FIFO Application 14 5 Data FIFO configuration registers This section contains the FIFO configuration registers These registers can only be written once To re configure the FIFO the device must be reset This is because the FIFO application requests RAM and RAM can only be allocated one time 14 5 4 FIFO configuration byte Table 14 1 FIFO Config Byte register Offset 0x00 Bit 7 6 5 4 3 2 1 0 Field Reserved DFC1 Mode Reset 0x00 0x00 0x00 Table 14 2 FIFO Config Byte bit descriptions Field Description Reserved Bit field reserved DFC1 Configures the payload size of the channel Data Format Units Non dimensional Code Range of val
178. the Normal and Legacy modes Address Normal Mode Legacy Mode 0 Command Command Response Response mailboxes mailboxes 19 20 Quick Read mailboxes 31 Figure 19 1 Difference between Normal and Legacy modes MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 189 MBOX Configuration Application 19 2 Normal mode In Normal mode only the command response communications model is supported In order to read valid data from the MMA955xL platform the host must send a command through the mailboxes and wait for the command to be processed Then the host must read back the mailboxes that now have the data The host can wait for the command to be processed by polling the Command Complete COCO bit or the host can wait for the INT_O interrupt The Normal mode fully supports streaming read transactions when the response to a command may be more than 32 bytes long The following procedure gives the sequence for setting up the interrupt pin to go active after a COCO MBO Set the APP ID Communication application 0x18 application identifier MBI Set the Command Write Config 0x20 application identifier MB2 Set the Offset to Zero field 0x00 to point to the configuration register MB3 Set the Count field to 0x01 This is done because only one data byte needs to be sent 5 MB4 Set the DATA 0x80 bit 7 T
179. the host tries to reconfigure the FIFO module The FIFO application configuration can only be written once In order to re configure 0x23 MEAR BO A IO SALED the FIFO the whole device must be reset This is because the FIFO application requests RAM and RAM can only be allocated one time Returned when the host wants to set a FIFO buffer size out of the memory oes NEED oe FIFO OVERSIZE boundaries within the MMA955xL device MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 61 Communication Interface MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 62 Freescale Semiconductor Inc Chapter 6 GPIO Application 6 1 Overview of GPIO application cum 0x03 The GPIO application assigns a bit from an application s status register to a specific GPIO pin The configuration registers contain the application ID and the bit number of the output byte for each GPIO pin Configuration Start on oe registers page 63 The GPIO application connects the MMA955xL platform s physical GPIO pins to status bits in an applications status registers The GPIO application Status can control four physical GPIO pins Each of the four GPIO pins GPIO6 registers 7 8 and 9 has an associated APP ID register and an SR bit register Default speed 488 Hz None The GPIO application also has a general polarity register where the GPIO
180. the reset sequence of the mailbox application 4 1 Initiates the reset sequence of the mailbox application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 182 Freescale Semiconductor Inc Reset Suspend Clear Control Application Table 18 4 Suspend bit descriptions continued Field Description GPIO 0 Disables the reset sequence of the GPIO application 3 1 Initiates the reset sequence of the GPIO application Command Interpreter 0 Disables the reset sequence of the command interpreter application 2 1 Initiates the reset sequence of the command interpreter application Scheduler 0 Disables the reset sequence of the scheduler application 1 1 Initiates the reset sequence of the scheduler application General Reset 0 Disables a system wide reset sequence of all MMA955xLapplications 0 e 1 Initiates a system wide reset sequence of all MMA955xLapplications MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 183 Reset Suspend Clear Control Application 18 3 Clear configuration register Table 18 5 Clear registers Offset MSB 0x08 reset bits 31 24 Bit 31 30 29 28 27 26 25 24 Field Reserved User User User User User User Application Application Application Application Applicat
181. threshold Any measurement below the low g threshold will be considered as a low g event This value applies to all three axes The reset value is 0x3E8 decimal 1000 Units Gravity units 1 ADC count 244 ug Range of valid values 1 244 ug to 32 767 0x7FFF for 8g 10 2 2 low g cnt min Table 10 3 low g cnt min registers Offset 0x02 Bit 7 6 5 4 3 2 1 0 Field low g cnt min Reset 0 0 0 0 1 0 0 0 Table 10 4 low g cnt min bit description Field Description low g cnt min An eight bit number that sets the time that a signal must be kept below the low g threshold in order to be considered as a low g event This value applies to all three axes Units Algorithm cycles Time low g cnt min 1 5R aug Range of valid values from 1 to 255 Reset value is 0x08 which corresponds to about 33 ms 8 x 1 244 Hz MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 108 Freescale Semiconductor Inc High g Low g Application 10 2 3 low g cfg Table 10 5 low g cfg registers Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field Reserved DBCNT LGOAE LGZEE LGYEE LGXEE Reset 0x00 1 0 1 1 1 Table 10 6 low_g_cfg bit descriptions Field Description DBCNT Determines whether the debounce counter will be decremented or cleared Range of valid values from 0 to 1 0 Clear the de
182. tion Auto Wake Sleep 18 0 Disables the reset sequence of the Auto Wake Sleep application 1 Initiates the reset sequence of the Auto Wake Sleep application Reserved Not used 17 Event FIFO 0 Disables the reset sequence of the Event Queue application 16 1 Initiates the reset sequence of the Event Queue application Data FIFO 0 Normal operation 15 1 Initiates the reset sequence of the Data FIFO application Frame Counter 0 Disables the reset sequence of the Frame Counter application 14 1 Initiates the reset sequence of the Frame Counter application User Application These are bits to use to reset user applications assigned to APP IDs 0x0D and Ox0C 11 13 12 0 Normal operation 1 Initiates the reset sequence if the user application Tilt Sensing 0 Disables the reset sequence of the Tilt Sensing application 1 Initiates the reset sequence of the Tilt Sensing application Tap Detection 0 Disables the reset sequence of the Tap Detection application 10 1 Initiates the reset sequence of the Tap Detection application Low g Detection 0 Disables the reset sequence of the Low g detection application 9 e 1 Initiates the reset sequence of the Low g detection application High g Detection 0 Disables the reset sequence of the High g detection application 8 1 Initiates the reset sequence of the High g detection app
183. tion Interface that is part of the hardware and firmware infrastructure of the platform Commands are sent from the host and through the slave communications port either SPI or IC The Communication Interface interprets the command and sends the data to the correct application It also responds with error codes when appropriate The Communications Interface works with the Mailbox application to implement the command and response The mailboxes functionality is configured with two applications the MBOX Configuration application APP ID 0x18 and the MBOX application APP ID 0x04 5 2 Mailbox interface Commands are received through a set of 32 mailboxes that are arranged consecutively to provide addressable memory regions Each mailbox can hold one byte of data After a command has completed the Communication Interface writes the results to the mailboxes and the results response out are retrieved by the host via the SPI or the IC slave interface The following figure shows the structure of the data packet when writing one byte into a specific mailbox Device Address 0x4C RAW Destination Mailbox Address Data Byte Stop Sji 0 O 1 1 JO O O JA A7 A6 A5 A4 A3 A2 A1 AO A D7 D6 D5 D4 D3 D2 D1 po A P Start Acknowledge Acknowledge Acknowledge Figure 5 1 12C interface writing one byte of information to a mailbox If the transactio
184. tion requests RAM and RAM can only be allocated one time 15 2 1 queue size Table 15 1 queue size registers Offset 0x00 MSB 0x01 LSB et 7 6 5 4 3 2 1 iia esi ES ae ee lites dnd 0 Field queue size Reset Table 15 2 queue size bit description Field Description queue size Defines the size in bytes that the Event Queue will reserve in order to store the data sent by any application Units Bytes Range of valid values 0 available RAM 0x1C8 decimal 456 is the maximum amount of RAM that can be requested from the MMA955xL device The RAM is shared by multiple applications so be careful not to set the FIFO to use more memory than is physically available That will cause unknown and undesirable results 15 2 2 queue wmrk Table 15 3 queue wmrk registers Offset 0x02 MSB 0x03 LSB Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Field queue_wmrk Reset Table 15 4 queue_wmrk bit description Field Description queue_wmrk Sets the count in bytes for the Event Queue to set or clear the watermark flag Units Bytes Range of valid values 0 to available bytes in the buffer MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 156 Freescale Semiconductor Inc Event Queue Application 15 2 3 queue timeout
185. uest memory RAM for User Application variables Second user image fe Set priority and activity of UserApplicationl Initilize User Application variables Third user image void resetCbFunction void void clearCbFunction void void UserApplicationl void Figure 21 1 Flash memory map The binding mechanism which happens at boot time requires that a user image application table be located at the beginning of a new page of 512 bytes If the table is at another address the binding process will not able to find the user images The application table starts with a 32 bit table identifier which is Ox9550CODE The application table also contains the number of applications and the parameters of each application in the order to be executed by the firmware scheduler The initialization function in the user application needs to reserve and initialize the data memory for public and private variables It also needs to configure the priority and activity of the application to be executed by the scheduler The reset function in the user application needs to do the things needed to reset the user application This function is used by the system and possibly other applications to reset the user application The clear function in the user application clears the output bytes of the user application This function is used by the system and possibly other applications to clear the outputs of the user application Figure 21 1 shows an e
186. uler determines what type of interrupt occurred If an application ready interrupt occurred such as afe results ready or mtim overflow that application s bit is set in the request to start register and the interrupt is acknowledged to the hardware If an application complete interrupt occurred because an application returned to the invoke scheduler function the application s bit is cleared in the started register and context is popped from the user stack 2 The highest priority started or request to start application is determined If this application is not started the context of the old application is pushed onto the user stack If the application is waiting to start a context switch pushes the embedded ColdFire processor s registers DO D2 A0 A1 SR PC MACSR and ACC onto the ColdFire processor s user stack It also pushes the address of the internal function invoke scheduler onto the user stack which causes the program flow to return to the scheduler when the application completes 3 The context switch modifies the ColdFire processor s supervisor stack to redirect the interrupt to return to the application in user mode This clears the request to start bit and sets the start bit for the application If the application is already started no context push is required The interrupt handler automatically returns to the application 5 When the scheduler finds no more applications at the current priority level it searches fo
187. ut_Bit_ID SR_00 register Offset 0x01 Bit 4 3 Field Output_Bit_ID SR_00 Reset 0x00 16 2 3 APP ID SR 01 Table 16 3 APP ID SR 01 register Offset 0x02 Bit 4 3 Field APP ID SR 01 Reset 0x07 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 162 Freescale Semiconductor Inc Status Register Application 16 2 4 Output Bit ID SR 01 Table 16 4 Output Bit ID SR 01 register Offset 0x03 Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR 01 Reset 0x01 16 2 55 APP ID SR 02 Table 16 5 APP ID SR 02 register Offset 0x04 Bit 7 6 5 4 3 2 1 0 Field APP ID SR 02 Reset 0x07 16 2 6 X Output Bit ID SR 02 Table 16 6 Output Bit ID SR 02 register Offset 0x05 Bit 7 6 5 4 3 2 1 0 Field Output Bit ID SR 02 Reset 0x02 16 2 7 APP ID SR 03 Table 16 7 APP ID SR 03 register Offset 0x06 Bit 7 6 5 4 3 2 1 0 Field APP ID SR 03 Reset 0x07 MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 163 Status Register Application 16 2 8 Output Bit ID SR 03 Table 16 8 Output Bit ID SR 03 register Offset 0x07 Bit 7 6 5 4 3 2 1 0 Field Output Bit I
188. uted 1 A pop operation is being executed Reserved Bit field reserved MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 149 Data FIFO Application Table 14 14 FIFO Status bit descriptions continued Field Description fifo ovf flag Indicates that FIFO buffer has reached the maximum number of entries allowed This meaning can vary depending of the mode of operation Units Non dimensional Range of valid values 0 Not overflow condition 1 Overflow condition fifo empty flag Indicates whether the FIFO buffer is empty Units Non dimensional Range of valid values 0 FIFO buffer is not empty 1 FIFO buffer is empty fifo wmrk flag Indicates when the entries in the FIFO buffer have reached the watermark count Units Non dimensional Range of valid values 0 Watermark not reached 1 Watermark reached MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 150 Freescale Semiconductor Inc Chapter 15 Event Queue Application 15 1 Overview of Event Queue application epum 0x10 This application manages a queue of asynchronous events The size of the Default speed 488 Hz queue is flexible and can be configured by writing to the queue size word within the configuration registers of the Event Queue Application Configuration Start
189. w of Reset Suspend Clear Control application o o ooooooooo 177 TELA BES birria a do dedicado ERROR Orb de Re d Ed EO a dod 177 A e 4 eoe OPAC Reed Deke Hake A E II 177 p Boe Tp E S T E E E EE ET EN E T EE 178 18 2 Configuration registers for Reset Suspend Clear Control applications 178 18 2 1 Reset configuration register ccosionsncaccipa paraa dun 178 18 2 2 Suspend configuration register 1 uide dog do RR IO A ee ws 181 18 3 Clear configuration register uius accedo sr 184 18 4 Reset Suspend Clear status registers 0 000 eea 187 18 5 Reboot to ROM CI from flash code ovccorcunceci ndea rocosa 187 18 6 Reboot to flash code from ROM Cl eaae sanat cea EIA 187 Chapter 19 MBOX Configuration Application 19 1 Overview of MBOX Configuration application ooooooocoonoooo o 189 192 Normal MOJE ee aai RA A eed 2 ane A 190 p RES quc MED DD eiaa a a a EE E eaa G i D a PCI 190 19 4 Configuring mailbox operational mode ococcccccccco eee 191 19 5 MBOX Configuration memory map and register 00 0c eee eee eee 191 19 5 1 MBOX Configuration memory map uiui c do EORR OU es Meh Roe al d CRT oes 191 19 5 2 MBOX Configuration register corrio cerrar 192 Chapter 20 Memory Allocation for User Applications 20 1 Overview of memory allocation arica AAA A 193 ER E eee rmm 195 Chapter 21 User Applications 21 1 Application binding 0 ete eee 197 SER ee ee ee A E ee ee eer re ae
190. w pass filters The two following tables contain the cut off frequency of the filters varying with the value of K and the sample rate at which the front end application is executed MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 80 Freescale Semiconductor Inc Analog Front End Application Table 8 3 Cut off frequency as a function of K and the sample rate for low pass filter LPF cut off frequency Hz Sample rate Sample rate Sample rate Samplerate Samplerate Samplerate Sample Sample rate 488 28 z 244 14 z 122 07 61 04 z 30 52 15 26 rate 7 63 3 81 1 56 13 28 07 14 03 7 02 3 51 1 75 0 88 0 4385 2 22 50 11 25 5 62 2 81 1 40 0 70 0 3516 0 1758 3 10 39 5 19 2 60 1 30 0 65 0 32 0 1623 0 0811 4 5 014 2 51 1 25 0 63 0 31 0 16 0 0783 0 0392 5 2 47 1 23 0 62 0 31 0 15 0 08 0 0385 0 0193 6 1 22 0 6116 0 31 0 15 0 08 0 04 0 0191 0 0096 7 0 61 0 30 0 15 0 08 0 04 0 02 0 0095 0 0048 8 0 30 0 15 0 08 0 04 0 02 0 01 0 0048 0 0024 9 0 15 0 076 0 04 0 02 0 01 0 0047 0 0024 0 0012 10 0 0759 0 038 0 019 0 0095 0 0047 0 0024 0 0012 0 0006 11 0 0379 0 019 0 0095 0 0047 0 0024 0 0012 0 0006 0 0003 12 0 019 0 0095 0 0048 0 0024 0 0012 0 0006 0 0003 0 0001 13 0 0095 0 0048 0 0024 0 0012 0 0006 0 0003 0 0001 0 00007 14 0 0047 0 0024 0 0012 0 0006 0 0003 0 0001 0 0007 0 00004 15 0 0024 0 0012 0 0006 0 0003 0 0002 0 00008 0 00004 0 00002
191. x0C 11 13 12 0 Normal operation 1 Initiates the reset sequence if the user application Tilt Sensing 0 Disables the reset sequence of the Tilt Sensing application 1 Initiates the reset sequence of the Tilt Sensing application Tap Detection 0 Disables the reset sequence of the Tap Detection application 10 1 Initiates the reset sequence of the Tap Detection application Low g Detection 0 Disables the reset sequence of the Low g detection application 9 e 1 Initiates the reset sequence of the Low g detection application High g Detection 0 Disables the reset sequence of the High g detection application 8 1 Initiates the reset sequence of the High g detection application Portrait Landscape 0 Disables the reset sequence of the portrait landscape application 7 1 Initiates the reset sequence of the portrait landscape application AFE 0 Disables the reset sequence of the front end application 6 1 Initiate the reset sequence of the front end application Reserved Reserved 5 Mailbox 0 Disables the reset sequence of the mailbox application 4 1 Initiates the reset sequence of the mailbox application MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 179 Reset Suspend Clear Control Application Table 18 2 Reset bit descriptions continued Field Description GPIO
192. xample of the structure of a user images with just one application The total number of applications is limited to 31 including the Freescale applications The number of user images is limited MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 198 Freescale Semiconductor Inc User Applications to three The Freescale firmware uses x of the tasks leaving x applications for users to implement in their systems The application identifiers used by the Freescale firmware are documented in Communication Interface on page 55 21 2 API The MMA9S3xL device s firmware provides an API for the user application code These API functions can be accessed through the instruction in Assembler Trap 7 The index of the desired function is in Register DO The indexes of the Freescale API table are described in the following enumeration typedef enum fsl api indx tag FSL API FN EVNT Q 0 eventFifo_push FSL_API_FN_REG_USER_IN Ex register user int FSL API FN REO DATA RAM 2 RequestDataRam FSL API FN GET APMAP PTR 3 get_apmap_ptr FSL_API_FN_APP_OUT_ADDR app_output_addr FSL API FN APP PARAM ADDR 5 app_param_addr FSL API FN IIR FILTER 6 iir filter FSL API FN GET DATA PTR Ty GetDataPtr MAX_FSL_API fsl_api_indx_tag The definitions of the indexes in the preceding enumeration are FSL API FN
193. y levels The MMA955xL platform uses an activity level attribute to indicate how physically active the device is The measured physical acceleration and motion actions of the device are classified into two ranges high activity and low activity The activity level is used with the priority level to determine which applications run first Applications can be set to run during these conditions Always run e Run during high activity e Run during low activity e Never run The activity level for each application is encoded in the upper two bits of the scheduler_parameters registers See Scheduler parameters register on page 50 The Sleep Wake application alone determines the activity level therefore high low activity is entirely a function of the sleep wake threshold parameters When in run mode the scheduler only executes applications with the high activity parameter bit set Similarly when in doze mode the scheduler only executes applications with the low activity parameter bit set Since these bits are separate an application has the option to set both to run regardless of the activity level MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 36 Freescale Semiconductor Inc Scheduler Application The low activity level parameter is like a filter which skips applications that would normally run after each AFE sample interval The idea is that when the sensor is not moving 1 e sitting on you
194. ze all variables that are used by the application The reset function should put the application in a state to be started or re started The clear function should clear out all the output or status results of the application Each image can have multiple applications Application tables must be located at specific locations in the flash memory so that the bootloader can find them In the programming application note and associated templates the compiler options and linker file are configured to properly locate the application tables at appropriate memory locations The following image shows the flash memory map with the Freescale and user memory sections MMA955xL Intelligent Motion Sensing Platform Software Reference Manual Rev 0 Freescale Semiconductor Inc 197 User Applications declspec app table app table t app table N 512 app table t app table TABLE IDENTIFIER table identifier 0x9559CODE 1 num of applications cbFunction amp initCbFunction init function address cbFunction amp resetCbFunction reset function address cbFunction amp clearCbFunction clear function address cbFunction amp UserApplication main function address Primary Freescale firmware uint8 t CUST FBID application id 7 number of parameter bytes 1 number of output bytes call back block for application 2 if used First user image void initCbFucntion void LP Req

Download Pdf Manuals

image

Related Search

Related Contents

User Manual F7000602 - Flash  日赤自動車保険連絡票(PDF 417KB)  The HD Service Manual  Installation von Parallels Desktop  Nature Power 50132 Instructions / Assembly  Catálogo de Ferramentas de Teste  TR-71wf TR-72wf TR-72wf-H  USB Mouse VGP-UMS32  C-MINIWASH Mini lyre à LEDs 7 x 10 W RGBW ( 4 en 1  Tour d`éclairage 9 mètres sur skid  

Copyright © All rights reserved.
Failed to retrieve file