MMA8491Q - Acceleration data streaming using the PIT on the Kinetis KL25Z MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMA8491Q - Acceleration data streaming using the PIT on the Kinetis KL25Z MCU

MMA8491Q - Acceleration data streaming using the PIT on the Kinetis KL25Z MCU

Hi Everyone,

 

I would like to present another example code/demo that reads acceleration data from the Xtrinsic MMA8491Q digital accelerometer and visualizes them using the FreeMASTER tool via USBDM interface. I have used recently released Xtrinsic MEMS sensors board that features three types of Xtrinsic sensors including the MMA8491Q and is fully compatible with the Freescale FRDM-KL25Z platform.

 

In comparison with other Xtrinsic accelerometers, the MMA8491Q is turned on at the rising edge on the EN pin and acquires only one sample for each of the three axes. It does not have any interrupt pins, instead there are three push-pull logic outputs which provide tilt detection at 45 degrees as the original target application was tamper detection. However, it is possible to read the 14-bit output values through the I2C port as demonstrated in my example below.

 

According to the User Manual, both SCL and SDA lines are connected through the 4.7K pull-up resistors to the I2C1 module (PTE1 and PTE0 pins) on the KL25Z128 MCU and the EN pin is connected to the PTA13 pin. The EN input needs to be kept high until a new data is ready (max. 900us) and read. In my code I use the PIT module to wait 1ms before reading the output values. This timer is also used to read the output data periodically at a fixed rate. The timeout period of the PIT is set to 500us. The MCU is, therefore, configured as follows:

 

void MCU_Init(void)

{

            //I2C1 module initialization     

       SIM_SCGC4 |= SIM_SCGC4_I2C1_MASK;        // Turn on clock to I2C1 module 

       SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK;       // Turn on clock to Port E module

       PORTE_PCR1 = PORT_PCR_MUX(6);            // PTE1 pin is I2C1 SCL line

       PORTE_PCR0 = PORT_PCR_MUX(6);            // PTE0 pin is I2C1 SDA line

       I2C1_F  = 0x14;                          // SDA hold time = 2.125us, SCL start hold time = 4.25us, SCL stop hold time = 5.125us 

       I2C1_C1 = I2C_C1_IICEN_MASK;             // Enable I2C1 module

  

            //Configure the PTA13 pin as an output to drive the EN input of the MMA8491Q

       SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;       // Turn on clock to Port A module

       PORTA_PCR13 = PORT_PCR_MUX(1);           // PTA13 is configured as GPIO

       GPIOA_PCOR |= 1<<13;                     // Set PTA13 pin low

       GPIOA_PDDR |= 1<<13;                     // PTA13 pin is an output

  

            //PIT initialization

       SIM_SCGC6 |= SIM_SCGC6_PIT_MASK;         // Turn on clock to to the PIT module

       PIT_LDVAL0 = 5240;                       // Timeout period = 500us

       PIT_MCR = PIT_MCR_FRZ_MASK;              // Enable clock for PIT, freeze PIT in debug mode

       PIT_TCTRL0 = PIT_TCTRL_TIE_MASK |        // Enable PIT interrupt

                   PIT_TCTRL_TEN_MASK;          // and PIT

  

            //Enable PIT interrupt on NVIC   

       NVIC_ICPR |= 1 << ((INT_PIT - 16) % 32);

       NVIC_ISER |= 1 << ((INT_PIT - 16) % 32);

}

 

In the PIT interrupt service routine (ISR), there is a variable Counter that is increased by one on every PIT interrupt (500us) and its value is then compared with two preset values. The first preset value EN_HIGH_TIME determines how long the EN pin will remain high to ensure a valid reading of a new set of output data. The second preset value DATA_UPDATE_PERIOD corresponds to the desired output data rate. At the end of the ISR, the PIT interrupt flag is cleared.

 

void PIT_IRQHandler()

{

       static int Counter = 0;

       Counter++;                                   // Each increment represents 500us

       switch (Counter)

    {

            case 1:

            GPIOA_PSOR |= 1<<13;                 // Set EN pin high

                     break;

            caseEN_HIGH_TIME:                        // 1ms passed

            DataReady = 1;                       // Data is ready

                     break;

            caseDATA_UPDATE_PERIOD:                  // 100ms passed

            Counter = 0;                         // Clear Counter at the end of the sample period

                     break;

            default:

                     break;

    }

       PIT_TFLG0 |= PIT_TFLG_TIF_MASK;              // Clear PIT interrupt flag

}

 

In the main loop, the DataReady variable is periodically checked and if it is set, the accelerometer data registers 0x01 - 0x06 are read and then the acceleration in units of g is calculated. Finally the EN pin is set low to reduce the current consumption and the DataReady variable is cleared.

 

if (DataReady)                                                                  // Is a new set of data ready?

{            

     AccData[0] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_X_MSB_REG);         // [7:0] are 8 MSBs of the 14-bit X-axis sample

     AccData[1] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_X_LSB_REG);         // [7:2] are the 6 LSB of 14-bit X-axis sample

     AccData[2] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_Y_MSB_REG);         // [7:0] are 8 MSBs of the 14-bit Y-axis sample

     AccData[3] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_Y_LSB_REG);         // [7:2] are the 6 LSB of 14-bit Y-axis sample

     AccData[4] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_Z_MSB_REG);         // [7:0] are 8 MSBs of the 14-bit Z-axis sample

     AccData[5] = I2C_ReadRegister(MMA8491Q_I2C_ADDRESS, OUT_Z_LSB_REG);         // [7:2] are the 6 LSB of 14-bit Z-axis sample

 

     Xout_14_bit = ((short) (AccData[0]<<8 | AccData[1])) >> 2;           // Compute 14-bit X-axis output value

     Yout_14_bit = ((short) (AccData[2]<<8 | AccData[3])) >> 2;           // Compute 14-bit Y-axis output value

     Zout_14_bit = ((short) (AccData[4]<<8 | AccData[5])) >> 2;           // Compute 14-bit Z-axis output value

                  

     Xout_g = ((float) Xout_14_bit) / SENSITIVITY;          // Compute X-axis output value in g's

     Yout_g = ((float) Yout_14_bit) / SENSITIVITY;          // Compute Y-axis output value in g's

     Zout_g = ((float) Zout_14_bit) / SENSITIVITY;          // Compute Z-axis output value in g's

                                       

     GPIOA_PCOR |= 1<<13;       // Set EN pin low

     DataReady = 0;                                                                                                                                

}                   

  

The calculated values can be watched in the "Variables" window on the top right of the Debug perspective or in the FreeMASTER application.

 

5678_5678.JPG

 

5679_5679.JPG

 

Attached you can find the complete source code written in the CW 10.3 as well as the FreeMASTER project.

 

If there are any questions regarding this simple application, do not hesitate to ask below. Your feedback or suggestions are also welcome.

 

Regards,

Tomas

 

Labels (1)
Attachments
Comments

Hi

I am trying to visualize the similar kind of thing using KL25Z board in FreeMaster. But the communication which i have used is through OpenSDA. The problem here is when i tried to plot the graph for  Xout_g, Yout_g and Zout_g i am getting some odd values for these variables. Is there any thing that i need to set to display those variables in terms of g.

Hi Charan,

I have also used the OpenSDA connection for this project. To display the Xout_g, Yout_g and Zout_g variables properly, make sure the Floating point IEEE type is selected (right click on the variable – Edit variable… - Variable Type = floating point IEEE, Size = 4 bytes).

Hope it helps.

Regards,

Tomas

Hi Thomas,

Thank you very much for your replay. I made that change and now it works fine.

Regards,

Charan

%3CLINGO-SUB%20id%3D%22lingo-sub-1101178%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMMA8491Q%20-%20Acceleration%20data%20streaming%20using%20the%20PIT%20on%20the%20Kinetis%20KL25Z%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101178%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20would%20like%20to%20present%20another%20example%20code%2Fdemo%20that%20reads%20acceleration%20data%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DMMA8491Q%22%20target%3D%22_blank%22%3EXtrinsic%20MMA8491Q%20digital%20accelerometer%3C%2FA%3E%20and%20visualizes%20them%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFREEMASTER%22%20target%3D%22_blank%22%3EFreeMASTER%20tool%3C%2FA%3E%20via%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fusbdm.sourceforge.net%22%20target%3D%22_blank%22%3EUSBDM%20interface%3C%2FA%3E.%20I%20have%20used%20recently%20released%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.element14.com%2Fcommunity%2Fcommunity%2Fknode%2Fdev_platforms_kits%2Felement14_dev_kits%2Ffreescale_xtrinsic_evk%22%20target%3D%22_blank%22%3EXtrinsic%20MEMS%20sensors%20board%3C%2FA%3E%20that%20features%20three%20types%20of%20Xtrinsic%20sensors%20including%20the%20MMA8491Q%20and%20is%20fully%20compatible%20with%20the%20Freescale%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFRDM-KL25Z%22%20target%3D%22_blank%22%3EFRDM-KL25Z%20platform%3C%2FA%3E.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20comparison%20with%20other%20Xtrinsic%20accelerometers%2C%20the%20MMA8491Q%20is%20turned%20on%20at%20the%20rising%20edge%20on%20the%20EN%20pin%20and%20acquires%20only%20one%20sample%20for%20each%20of%20the%20three%20axes.%20It%20does%20not%20have%20any%20interrupt%20pins%2C%20instead%20there%20are%20three%20push-pull%20logic%20outputs%20which%20provide%20tilt%20detection%20at%2045%20degrees%20as%20the%20original%20target%20application%20was%20tamper%20detection.%20However%2C%20it%20is%20possible%20to%20read%20the%2014-bit%20output%20values%20through%20the%20I2C%20port%20as%20demonstrated%20in%20my%20example%20below.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAccording%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fwww.element14.com%2Fcommunity%2Fdocs%2FDOC-54623%2Fl%2Felement14-user-guide-for-xtrinsic-sensors-evaluation-kit%22%20target%3D%22_blank%22%3EUser%20Manual%3C%2FA%3E%2C%20both%20SCL%20and%20SDA%20lines%20are%20connected%20through%20the%204.7K%20pull-up%20resistors%20to%20the%20I2C1%20module%20(PTE1%20and%20PTE0%20pins)%20on%20the%20KL25Z128%20MCU%20and%20the%20EN%20pin%20is%20connected%20to%20the%20PTA13%20pin.%20The%20EN%20input%20needs%20to%20be%20kept%20high%20until%20a%20new%20data%20is%20ready%20(max.%20900us)%20and%20read.%20In%20my%20code%20I%20use%20the%20PIT%20module%20to%20wait%201ms%20before%20reading%20the%20output%20values.%20This%20timer%20is%20also%20used%20to%20read%20the%20output%20data%20periodically%20at%20a%20fixed%20rate.%20The%20timeout%20period%20of%20the%20PIT%20is%20set%20to%20500us.%20The%20MCU%20is%2C%20therefore%2C%20configured%20as%20follows%3A%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3EMCU_Init%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2FI2C1%20module%20initialization%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC4%20%7C%3D%20SIM_SCGC4_I2C1_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20I2C1%20module%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC5%20%7C%3D%20SIM_SCGC5_PORTE_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20Port%20E%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTE_PCR1%20%3D%20PORT_PCR_MUX(6)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20PTE1%20pin%20is%20I2C1%20SCL%20line%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTE_PCR0%20%3D%20PORT_PCR_MUX(6)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20PTE0%20pin%20is%20I2C1%20SDA%20line%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C1_F%26nbsp%3B%20%3D%200x14%3B%3C%2FSPAN%3E%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20SDA%20hold%20time%20%3D%202.125us%2C%20SCL%20start%20hold%20time%20%3D%204.25us%2C%20SCL%20stop%20hold%20time%20%3D%205.125us%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I2C1_C1%20%3D%20I2C_C1_IICEN_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Enable%20I2C1%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2FConfigure%20the%20PTA13%20pin%20as%20an%20output%20to%20drive%20the%20EN%20input%20of%3C%2FSPAN%3E%20the%20MMA8491Q%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC5%20%7C%3D%20SIM_SCGC5_PORTA_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20Port%20A%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PORTA_PCR13%20%3D%20PORT_PCR_MUX(1)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20PTA13%20is%20configured%20as%20GPIO%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20GPIOA_PCOR%20%7C%3D%201%26lt%3B%26lt%3B13%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Set%20PTA13%20pin%3C%2FSPAN%3E%20low%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20GPIOA_PDDR%20%7C%3D%201%26lt%3B%26lt%3B13%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20PTA13%20pin%20is%20an%20output%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2FPIT%20initialization%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SIM_SCGC6%20%7C%3D%20SIM_SCGC6_PIT_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Turn%20on%20clock%20to%20to%20the%20PIT%20module%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PIT_LDVAL0%20%3D%205240%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Timeout%20period%20%3D%20500us%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PIT_MCR%20%3D%20PIT_MCR_FRZ_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Enable%20clock%20for%20PIT%2C%20freeze%20PIT%20in%20debug%20mode%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PIT_TCTRL0%20%3D%20PIT_TCTRL_TIE_MASK%20%7C%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Enable%20PIT%20interrupt%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20PIT_TCTRL_TEN_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20and%20PIT%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2FEnable%20PIT%20interrupt%20on%20NVIC%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20NVIC_ICPR%20%7C%3D%201%20%26lt%3B%26lt%3B%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000c0%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CEM%3EINT_PIT%3C%2FEM%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E-%2016)%20%25%2032)%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20NVIC_ISER%20%7C%3D%201%20%26lt%3B%26lt%3B%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000c0%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CEM%3EINT_PIT%3C%2FEM%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E-%2016)%20%25%2032)%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20PIT%20interrupt%20service%20routine%20(ISR)%2C%20there%20is%20a%20variable%20Counter%20that%20is%20increased%20by%20one%20on%20every%20PIT%20interrupt%20(500us)%20and%20its%20value%20is%20then%20compared%20with%20two%20preset%20values.%20The%20first%20preset%20value%20EN_HIGH_TIME%20determines%20how%20long%20the%20EN%20pin%20will%20remain%20high%20to%20ensure%20a%20valid%20reading%20of%20a%20new%20set%20of%20output%20data.%20The%20second%20preset%20value%20DATA_UPDATE_PERIOD%20corresponds%20to%20the%20desired%20output%20data%20rate.%20At%20the%20end%20of%20the%20ISR%2C%20the%20PIT%20interrupt%20flag%20is%20cleared.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Evoid%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSTRONG%3EPIT_IRQHandler%3C%2FSTRONG%3E()%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Estatic%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eint%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3ECounter%20%3D%200%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3ECounter%2B%2B%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Each%20increment%20represents%20500us%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eswitch%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E(Counter)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ecase%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E1%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20GPIOA_PSOR%20%7C%3D%201%26lt%3B%26lt%3B13%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Set%20EN%20pin%20high%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ebreak%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ecase%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3EEN_HIGH_TIME%3A%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%201ms%20passed%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DataReady%20%3D%201%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Data%20is%20ready%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ebreak%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ecase%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3EDATA_UPDATE_PERIOD%3A%3C%2FSPAN%3E%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20100ms%20passed%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20Counter%20%3D%200%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Clear%20Counter%20at%20the%20end%20of%20the%20sample%20period%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ebreak%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Edefault%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Ebreak%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20black%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3EPIT_TFLG0%20%7C%3D%20PIT_TFLG_TIF_MASK%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Clear%20PIT%20interrupt%20flag%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20main%20loop%2C%20the%20DataReady%20variable%20is%20periodically%20checked%20and%20if%20it%20is%20set%2C%20the%20accelerometer%20data%20registers%200x01%20-%200x06%20are%20read%20and%20then%20the%20acceleration%20in%20units%20of%20g%20is%20calculated.%20Finally%20the%20EN%20pin%20is%20set%20low%20to%20reduce%20the%20current%20consumption%20and%20the%20DataReady%20variable%20is%20cleared.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eif%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E(DataReady)%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20Is%20a%20new%20set%20of%20data%20ready%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%7B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20AccData%5B0%5D%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_X_MSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A0%5D%20are%208%20MSBs%20of%20the%2014-bit%20X-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%22%3EAccData%5B1%5D%3C%2FSPAN%3E%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_X_LSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A2%5D%20are%20the%206%20LSB%20of%2014-bit%20X-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%22%3EAccData%5B2%5D%3C%2FSPAN%3E%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_Y_MSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A0%5D%20are%208%20MSBs%20of%20the%2014-bit%20Y-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%22%3EAccData%5B3%5D%3C%2FSPAN%3E%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_Y_LSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A2%5D%20are%20the%206%20LSB%20of%2014-bit%20Y-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%22%3EAccData%5B4%5D%3C%2FSPAN%3E%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_Z_MSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A0%5D%20are%208%20MSBs%20of%20the%2014-bit%20Z-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20black%3B%20font-size%3A%2010pt%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%22%3EAccData%5B5%5D%3C%2FSPAN%3E%20%3D%20I2C_ReadRegister(MMA8491Q_I2C_ADDRESS%2C%20OUT_Z_LSB_REG)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%20font-size%3A%2010pt%3B%22%3E%2F%2F%20%5B7%3A2%5D%20are%20the%206%20LSB%20of%2014-bit%20Z-axis%20sample%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Xout_14_bit%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eshort%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20(AccData%5B0%5D%26lt%3B%26lt%3B8%20%7C%20AccData%5B1%5D))%20%26gt%3B%26gt%3B%202%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%2014-bit%20X-axis%20output%20value%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Yout_14_bit%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eshort%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20(AccData%5B2%5D%26lt%3B%26lt%3B8%20%7C%20AccData%5B3%5D))%20%26gt%3B%26gt%3B%202%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%2014-bit%20Y-axis%20output%20value%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Zout_14_bit%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Eshort%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20(AccData%5B4%5D%26lt%3B%26lt%3B8%20%7C%20AccData%5B5%5D))%20%26gt%3B%26gt%3B%202%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%2014-bit%20Z-axis%20output%20value%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Xout_g%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20Xout_14_bit)%20%2F%20SENSITIVITY%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%20X-axis%20output%20value%20in%20g's%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Yout_g%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20Yout_14_bit)%20%2F%20SENSITIVITY%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%20Y-axis%20output%20value%20in%20g's%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Zout_g%20%3D%20((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%22%3E%3CSTRONG%3Efloat%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E)%20Zout_14_bit)%20%2F%20SENSITIVITY%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Compute%20Z-axis%20output%20value%20in%20g's%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20GPIOA_PCOR%20%7C%3D%201%26lt%3B%26lt%3B13%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%20Set%20EN%20pin%20low%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DataReady%20%3D%200%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%20line-height%3A%201.5em%3B%22%3E%7D%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20calculated%20values%20can%20be%20watched%20in%20the%20%22Variables%22%20window%20on%20the%20top%20right%20of%20the%20Debug%20perspective%20or%20in%20the%20FreeMASTER%20application.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225678_5678.JPG%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225678_5678.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117206i6932E833E53D1632%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225678_5678.JPG%22%20alt%3D%225678_5678.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225679_5679.JPG%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225679_5679.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117207i7FF9CD26C1AA7AAC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225679_5679.JPG%22%20alt%3D%225679_5679.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3EAttached%20you%20can%20find%20the%20complete%20source%20code%20written%20in%20the%20CW%2010.3%20as%20well%20as%20the%20FreeMASTER%20project.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20there%20are%20any%20questions%20regarding%20this%20simple%20application%2C%20do%20not%20hesitate%20to%20ask%20below.%20Your%20feedback%20or%20suggestions%20are%20also%20welcome.%3C%2FP%3E%0A%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3ETomas%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1101178%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAccelerometers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1101181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MMA8491Q%20-%20Acceleration%20data%20streaming%20using%20the%20PIT%20on%20the%20Kinetis%20KL25Z%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Thomas%2C%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20for%20your%20replay.%20I%20made%20that%20change%20and%20now%20it%20works%20fine.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ECharan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1101180%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MMA8491Q%20-%20Acceleration%20data%20streaming%20using%20the%20PIT%20on%20the%20Kinetis%20KL25Z%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101180%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Charan%2C%3C%2FP%3E%3CP%3EI%20have%20also%20used%20the%20OpenSDA%20connection%20for%20this%20project.%20To%20display%20the%20Xout_g%2C%20Yout_g%20and%20Zout_g%20variables%20properly%2C%20make%20sure%20the%20Floating%20point%20IEEE%20type%20is%20selected%20(right%20click%20on%20the%20variable%20%E2%80%93%20Edit%20variable%E2%80%A6%20-%20Variable%20Type%20%3D%20floating%20point%20IEEE%2C%20Size%20%3D%204%20bytes).%3C%2FP%3E%3CP%3EHope%20it%20helps.%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1101179%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MMA8491Q%20-%20Acceleration%20data%20streaming%20using%20the%20PIT%20on%20the%20Kinetis%20KL25Z%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101179%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20visualize%20the%20similar%20kind%20of%20thing%20using%20KL25Z%20board%20in%20FreeMaster.%20But%20the%20communication%20which%20i%20have%20used%20is%20through%20OpenSDA.%20The%20problem%20here%20is%20when%20i%20tried%20to%20plot%20the%20graph%20for%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2013.63636302948px%3B%22%3EXout_g%2C%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2013.63636302948px%3B%22%3E%20Yout_g%20and%20%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2013.63636302948px%3B%22%3EZout_g%20i%20am%20getting%20some%20odd%20values%20for%20these%20variables.%20Is%20there%20any%20thing%20that%20i%20need%20to%20set%20to%20display%20those%20variables%20in%20terms%20of%20g.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-11-2020 10:30 AM
Updated by: