English
Language : 

LSM303AGR Datasheet, PDF (38/68 Pages) STMicroelectronics – ultra-low-power 3D accelerometer and 3D magnetometer
Digital interfaces
LSM303AGR
(MSb) first. If a receiver can’t receive another complete byte of data until it has performed
some other function, it can hold the clock line SCL low to force the transmitter into a wait
state. Data transfer only continues when the receiver is ready for another byte and releases
the data line. If a slave receiver doesn’t acknowledge the slave address (i.e. it is not able to
receive because it is performing some real-time function) the data line must be left high by
the slave. The master can then abort the transfer. A low-to-high transition on the SDA line
while the SCL line is high is defined as a STOP condition. Each data transfer must be
terminated by the generation of a STOP (SP) condition.
In the presented communication format MAK is Master acknowledge and NMAK is No
Master Acknowledge.
Default address:
The accelerometer sensor slave address is 0011001b while magnetic sensor slave address
is 0011110b.
The slave addresses are completed with a Read/Write bit. If the bit was ‘1’ (Read), a
repeated START (SR) condition must be issued after the two sub-address bytes. If the bit is
‘0’ (Write) the master will transmit to the slave with direction unchanged. Table 23 and
Table 24 explain how the SAD+Read/Write bit patterns are composed, listing all the
possible configurations.
Linear acceleration sensor: the default (factory setting) 7-bit slave address is
0011001b.
Command
Read
Write
Table 23. SAD + Read/Write patterns
SAD[6:0]
R/W
SAD + R/W
0011001
1
00110011 (33h)
0011001
0
00110010 (32h)
Magnetic field sensor: the default (factory setting) 7-bit slave address is 0011110b.
Command
Read
Write
Table 24. SAD + Read/Write patterns
SAD[6:0]
R/W
SAD + R/W
0011110
1
00111101 (3Dh)
0011110
0
00111100 (3Ch)
6.2
SPI bus interface
The LSM303AGR SPI is a bus slave. The SPI allows writing and reading the registers of the
device.
The serial interface interacts with the application using 3 wires: CS_XL or CS_MAG, SPC,
SDI/O.
38/68
DocID027765 Rev 5