BMM150_HelloWorld Christian Dupaty 03/2021 Library and demo for BMM150 see datasheet here : https://www.bosch-sensortec.com/products/motion-sensors/magnetometers-bmm150/ Adaptation of BOSCH driver https://github.com/BoschSensortec/BMM150-Sensor-API for ARM MBED and tested on NUCLEO-L073RZ and GEOMAGNETIC CLICK https://www.mikroe.com/geomagnetic-click

Dependencies:   mbed bmm150GeoMagnetic

BMM150_HelloWorld

Christian Dupaty 03/2021

Library and demo for BMM150 see datasheet here : https://www.bosch-sensortec.com/products/motion-sensors/magnetometers-bmm150/

Adaptation of BOSCH driver https://github.com/BoschSensortec/BMM150-Sensor-API for ARM MBED and tested on NUCLEO-L073RZ and GEOMAGNETIC CLICK https://www.mikroe.com/geomagnetic-click

https://os.mbed.com/media/uploads/cdupaty/geomagneticclick.jpg

The BMM150 sensor supports I2C and SPI serial communications. The choice of protocol is made on the PS pin (see datasheet page 32), the default mode is SPI. Unfortunately, MIKROE did not place a configuration micro-switch on the GeoMagnetic-click module, but straps that are difficult to move. By default, the module is configured in SPI mode (all the straps are on the left as in the photo). To place the module in I2C mode, all the straps must be moved to the right.

However, it is possible to implement I2C communications without moving all the straps:

- Move only the strap at the bottom on the photo to the right. - On the left connector we have now :

- CS is connected to CSB-BMM150

- SCK is connected to SCL-I2C-BMM150

- MISO is linked to SDO-BMM150

- MOSI is connected to SDA-I2C-BMM150

BMM150 DataSheet page 36, CSB and SDO are used to define the I2C address. In the program, this address is chosen in BMM150_defs.h line 37 (here address 0x13, therefore CSB = 1 and SDO = 1) define BMM150_I2C_Address (0x13 << 1)

SCL and SDA lines must be connected to 3.3v by pullup resistor (4.4K to 10K) to comply with the I2C standard

Supply with the NUCLEO card in 3.3v and GND

The heading is given periocally by UART over USB in an ASCII terminal (ex TeraTerm)

https://os.mbed.com/media/uploads/cdupaty/bmm150_cap.jpg

Video here ... https://photos.app.goo.gl/zqKQNfw5694xbMZCA

Download repository: zip gz

Files at revision 8:a268ea639af1

Name Size Actions
[up]
bmm150.lib 71 Revisions Annotate
main.cpp 1890 Revisions Annotate
mbed.bld 69 Revisions Annotate