OpenImu330 SPI
OpenIMU330 operates as a slave device. The master device must be configured to communicate with the OpenIMU330 using the following settings:
- Data transferred in 16-bit word-length and MSB-first
- fCLK ≤ 2.0 MHz
- CPOL = 1 (clock polarity) and CPHA = 1 (clock phase)
OpenIMU330 has 128 8-bit registers accessible via SPI interface for read and write. The usage of these registers is completely user-defined in time of FW development.
OpenIMU330 SPI Register Read Methodology
SPI-master initiates a register read (for example register 0x04) by clocking in the address followed by 0x00, i.e. 0x0400, via MOSI; this combination is referred to as a read-command. This is followed by 16 zero-bits to complete the SPI data-transfer cycle.
As the master transmits the read command over MOSI, the OpenIMU330 transmits information back over MISO. In this transmission, the first data-word sent by the OpenIMU330 (as the read-command is sent) consists of 16-bits of non-applicable data. The subsequent 16-bit message contains information stored in two consecutive registers (in this case registers 4 (MSB) and 5(LSB))
OpenIMU330 SPI Port Block Mode Read
User can implement reading blocks of data with arbitrary length and information. Specific dedicated register address will indicate request specific block of data. For example, register address 0x3e (62) indicates request for reading data block containing current data from unit sensors. Table 2 lists corresponding parameters.
Number of SPI clock pulses should be exactly equal to the length of predefined data packet (in this case – 144 (16 for address 128 for data)) otherwise interface may go out of sync
OpenIMU330 DRDY signal rate selection
Register 55 (0x37) dedicated for controlling the rate (frequency) of DRDY output signal.
This signal indicates that the new sensors data set is ready
Next values can be written into this register:
Value | DRDY signal Frequency (Hz) | Notes |
0 | 0 |
|
1 | 200 | Default |
2 | 100 |
|
3 | 50 |
|
4 | 25 |
|
5 | 20 |
|
6 | 10 |
|
7 | 5 |
|
8 | 4 |
|
9 | 2 |
|
OpenIMU330 SPI Register Write Methodology
The SPI master device can perform write into any register. The unit reaction on write operation is completely defined by the user. By default, corresponding data written without any reaction from unit. Written data can be read back.
Unlike reads, writes are performed one byte at a time.
The following example highlights how write-commands are formed:
- Select the write address of the desired register, for example 0x35
-
Change the most-significant bit of the register address to 1 (the write-bit), e.g. 0x35 becomes 0xB5
Create the write command by appending the write-bit/address combination with the value to be written to the register (for example 0x04) - 0xB504