Hello Juan Manuel,
The MMA7660 output data rate can be set in register $08 [0:2], AMSR. Detailed information regarding its proper configuration can be found in page 19 of the following document:
http://cache.freescale.com/files/sensors/doc/data_sheet/MMA7660FC.pdf
In order for you to write into register $08 you should follow the sequence shown in page 3 of the following document:
http://cache.freescale.com/files/sensors/doc/app_note/AN3945.pdf
Let’s say you want a 32 g-cell measurements every 1000 ms, then you should write the following:
AMSR[2:0] = 010 // 32 Samples/Second Active and Auto-Sleep Mode
AWSR[1:0] = 00 // 32 Samples/Second Auto-Wake Mode
FILT[2:0] = 011 // 4 measurement samples at the rate set by AMSR[2:0] or AWSR[1:0] have to match before // the device updates portrait/landscape data in TILT (0x03) register
Hence, register 0x08 = b01100010, which equals to 0x62. Therefore, Zstar command sequence would be as follow:
Send(0x20) //command header
Send(‘m’) //Character command for device Write Reg
Send(‘0’) // Device address to write to – hi byte hi nibble
Send(´8´) // Device address to write to – hi byte lo nibble
Send(‘6’) //Data byte – hi nibble
Send(‘2’) // Data byte – lo nibble
Hope it helps.
Regards,
Josh