Error Code on MMA68XX

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

Error Code on MMA68XX

507 Views
purusoth
Contributor I

Hi,

I am using MMA68XX 100g Accelerometer for my testing.I am able to read the x and y axis through SPI.

I have enabled the signed data for X and Y axis. Sometimes the acceleration read response received over SPI  is "512". 

Is this value indicates an error?

how to check the error code status for SPI Acceleration request operation?

In Datasheet it is mentioned as error status would be returned on the next command passed to SPI.is this correct?

Also how to differentiate internal,spi miso error and other errors?

In Data sheet it is mentioned to convert the acceleration "10-bit data" to "Gravity" it need to be multiplied by sensitivity.

Is this correct? or do i have to handle additional calculation for converting "Signed Raw data" to "Gravity" ?

Labels (1)
Tags (1)
0 Kudos
1 Reply

358 Views
darioarias
NXP Employee
NXP Employee

Hello Puru,

When you  are using the signed configuration the range is from -512 to 511, -512 is indeed the Fault Response Code (see table 34 from the MMA68xx datasheet). The error codes are summarized in Table 30. "SPI Response Message Summary" and later with more detail in section 5.5 "Exception Handling."

You are correct, the response  or acceleration data is transmitted on the next SPI message if everything in the communication is correct, otherwise it returns the status error.

I previously mentioned the "SPI Response Message Summary",   in this table there is a section named "Error Responses", that tells you how to differentiate from every error response.

No additional calculation is needed, just the signed decimal value from the 10-bit digital output multiplied by the sensitivity (g/LSB) and you get the acceleration in Gs. Note that the acceleration is given in LSB/g so you need to calculate the reciprocal.

Example: reciprocal(4.096 LSB/g) x 480 LSB  =  117.19 g   (trimmed for maximum range)

Darío

0 Kudos