Usage of register pointer read and write in G-Sensor (MMA690xKQ)

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

Usage of register pointer read and write in G-Sensor (MMA690xKQ)

1,150 Views
manojkp04
Contributor I

Hello,

I am using High Accuracy Low g Inertial Sensor (MMA690xKQ) in my project. I have read the specification but I am unable to find the use case of Register Pointer Read and Register Pointer Write in Table 3.4, 3.5, 3.6, 3.7.

Kindly let me know how to use Register Pointer Read and Register Pointer Write and also the meaning of bits A[7:0] is the same tables.

Labels (1)
0 Kudos
Reply
3 Replies

893 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Manojkumar,

The SPI protocol for the MMA690x devices does not allow for transmission of both a register address and register data in the same command.  The address must be set by a previous command.  This is the purpose of the Register Pointer Write command.  The Register Pointer is the address at which data will be read from or written to when a Register Data Write or Register Data Read is executed.  So the normal sequence for a register read or a register write will take at least 2 commands:

 

  • Register Read:
    • Send a “Register Pointer Write” command to set the pointer to the register address to be read
    • Send a “Register Data Read” command to retrieve the data from the register pointed to
  • Register Write:
    • Send a “Register Pointer Write” command to set the pointer to the register address to be read
    • Send a “Register Data Read” command to retrieve the data from the register pointed to

 

Note that the MISO response for each MOSI command will come on the subsequent transfer.  As shown in the image below.

 

Here are a few examples.

 

  • Read Register $10 (DEVSTAT)
    • Register Pointer Write to $10
      • MOSI                    = 0x1410
      • Expected MISO  = 0x0800
    • Register Data Read
      • MOSI                    = 0x2000
      • Expected MISO  = 0x1000              (assumes no flags set in DEVSTAT)
  • Write 0x01 to Register $0E (Enable Positive Self-Test)
    • Register Pointer Write to $0E
      • MOSI                    = 0x140E
      • Expected MISO  = 0x0800
    • Register Data Write
      • MOSI                    = 0x3001
      • Expected MISO  = 0x180E              (includes address echo)
    • Register Data Read to Confirm
      • MOSI                    = 0x2000
      • Expected MISO  = 0x1401

 

pastedImage_4.png

 

I hope this is clear.

Best regards,

Tomas

0 Kudos
Reply

893 Views
jayarao
Contributor I

Hello

For any register reading I am getting E6 or FE response

can you please help me on exact response

clock is good and CS pin also ok

0 Kudos
Reply

893 Views
jayarao
Contributor I

Hello

register address: e       register address:14     message transmitted

STATUS is 0xe0-0x00-0x00-0x00

E0 00 STATUS is 0xe0-0x00-0x00-0x00
serialNo - 0:e0

printf device status register

register address:1   register address:30    message transmitted

STATUS is 0xff-0xff-0x00-0x00

FF FF STATUS is 0xff-0xff-0x00-0x00
serialNo - 0:ff

printf device status register

register address:0   register address:20    message transmitted

STATUS is 0xe6-0x00-0x00-0x00

E6 00 STATUS is 0xe6-0x00-0x00-0x00
serialNo - 0:e6

this is the response I am getting

Please help me on the exact response

0 Kudos
Reply