English
Language : 

M-G362 Datasheet, PDF (55/69 Pages) Epson Company – IMU (Inertial Measurement Unit)
8. Sample Program Sequence
The following describes the recommended procedures for operating this device.
8.1 SPI Sequence
8.1.1 Power-on sequence (SPI)
Power-on sequence is as follows.
(a) power-on.
(b) Wait 800ms.
(c) Wait until NOT_READY bit goes to 0. NOT_READY is GLOB_CMD[0x0A(W1)]'s bit[10].
TXdata={0xFE01}/ RXdata={0x----}.
/* WINDOW=1 */
TXdata={0x0A00}/ RXdata={0x----}.
/* GLOB_CMD read command */
TXdata={0x0000}/ RXdata={GLOB_CMD}. /* get response */
Confirm NOT_READY bit.
When NOT_READY becomes 0, it ends. Otherwise , please repeat (c).
(d) Confirm HARD_ERR bits. HARD_ERR is DIAG_STAT[0x04(W0)]'s bit[6:5].
TXdata={0xFE00}/ RXdata={0x----}.
/* WINDOW_ID write command.(WINDOW=0) */
TXdata={0x0400}/ RXdata={0x----}.
/* DIAG_STAT read command */
TXdata={0x0000}/ RXdata={DIAG_STAT}. /* get response */
Confirm HARD_ERR is 00.
If HARD_ERR is 00, the IMU is OK. Otherwise, the IMU is faulty.
-:don't care
8.1.2 Register read and write (SPI)
[Read Example]
To read a 16bit-data from a register(addr=0x02 / WINDOW=0).
TXdata={0xFE00}/ RXdata={0x----}.
/* WINDOW=0 */
TXdata={0x0200}/ RXdata={0x----}.
/* read command */
TXdata={0x----}/ RXdata={0x0400}.
/* get response*/
-:don't care
0x04 in high byte of RXdata is Configuration mode.
0x00 in low byte of RXdata is Reserved.
Please note that read data unit is 16bit, and Most Significant Bit first in 16bit SPI.
-------------------------------------------------------------
[Write Example]
To write a 8bit-data into a register(addr=0x03 / WINDOW=0).
TXdata={0xFE00}/ RXdata={0x----}.
/* WINDOW=0 */
TXdata={0x8301}/ RXdata={0x----}.
/* write command */
There is no response at Write.
-:don't care
By sending this command, the IMU moves to Sampling mode.
Please note that write data unit is 8bit.
8.1.3 Sampling data (SPI)
[Sample Flow 1 (SPI normal mode)]
Power-on sequence. Please refer to Chapter 8.1.1.
M-G362PDC1 Data Sheet
Seiko Epson Corporation
51
Rev.20131217