| Electronic Components Datasheet Search |
|
AN4650 Datasheet(PDF) 69 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4650 Datasheet(HTML) 69 Page - STMicroelectronics |
|
69 / 102 page ![]() DocID027415 Rev 1 69/102 AN4650 Mode 2 - sensor hub mode 102 The code provided below gives a basic routine to configure the LIS3MDL external magnetometer sensor (refer to the datasheet for additional details) in continuous-conversion mode, initialize the hard-iron and soft-iron correction registers and read the magnetometer output registers. In this case, the pass-through feature is not used for the magnetometer configuration. YZ -0.130089 MAG_SI_YZ = 81h ZX +0.052327 MAG_SI_ZX = 00h ZY -0.130089 MAG_SI_ZY = 81h ZZ +1.243645 MAG_SI_ZZ = 0Ah 1 Write 80h into FUNC_CFG_ADDRESS // Enable access to embedded functions registers 2 Write 38h into SLV0_ADD // LIS3MDL slave address = 0011100b (if SDO=0) // Enable write operation (rw_0=0) 3 Write 22h into SLV0_SUBADD // 22h is the LIS3MDL register to be written 4 Write 00h into DATAWRITE_SRC_MODE_SUB_SLV0 // 00h is the value to be written in register 22h of // LIS3MDL to configure it in continuous // conversion mode 5 Write 00h into FUNC_CFG_ADDRESS // Disable access to embedded functions registers 6 Write 3Ch into CTRL10_C // Enable embedded functions 7 Write 09h into MASTER_CONFIG // Enable internal pull-up on SDx/SCx lines // Sensor hub trigger signal is XL Data Ready // Enable auxiliary I2C master 8 Write 80h into CTRL1_XL // Turn-on the accelerometer (for trigger signal) 9 Write 38h into CTRL10_C // Disable embedded functions 10 Write 00h into MASTER_CONFIG // Disable auxiliary I2C master 11 Write 00h into CTRL1_XL // Turn-off the accelerometer 12 Write 80h into FUNC_CFG_ADDRESS // Enable access to embedded functions registers 13 Write 39h into SLV0_ADD // LIS3MDL slave address = 0011100b (if SDO=0) // Enable read operation (rw_0=1) 14 Write 28h into SLV0_SUBADD // 28h is the first LIS3MDL output register to be // read 15 Write 06h into SLAVE0_CONFIG // No decimation // 1 external sensor connected // Number of registers to read = 6 16 Write F7h into MAG_OFFX_H // X offset value initialization 17 Write 08h into MAG_OFFX_L // X offset value initialization Table 51. Soft-iron register values (continued) Soft-iron matrix elements Register values |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |