Tableau à clic géomagnétique
Tableau à clic géomagnétique
Overview
Le GeoMagnetic Click Board™ est un Click Board™ magnétométrique numérique capable de mesurer le champ géomagnétique sur trois axes perpendiculaires. Le capteur embarqué utilise FlipCore, une technologie exclusive de Bosch, qui permet d'obtenir des performances soigneusement réglées, adaptées aux applications mobiles à 3 axes exigeantes, telles qu'une boussole électronique à compensation d'inclinaison, des contrôleurs de jeu, des applications de réalité augmentée et des applications similaires qui nécessitent une mesure magnétométrique à 3 axes fiable et précise.
Three-axis Geomagnetic Sensor
The GeoMagnetic Click Board™ is a digital magnetometric board which can measure the geomagnetic field in three perpendicular axes. The on-board sensor uses FlipCore - a proprietary technology from Bosch, which results with a carefully tuned performance, tailored for demanding 3-axis mobile applications, such as a tilt-compensated electronic compass, gaming controllers, augmented reality applications and similar applications which require reliable and precise 3-axis magnetometric measurement.
Besides the magnetic field measurement functions, the GeoMagnetic Click Board™ also provides an advanced programmable interrupt engine, which allows for a flexible design and responsiveness of the application. The GeoMagnetic Click Board™ can use either SPI or I2C interface to communicate with the host controller. All these features make the GeoMagnetic Click Board™ an easy to use and reliable solution for a rapid development of geomagnetic based applications.
How Does it Work?
The GeoMagnetic Click Board™ carries the BMM150, a three-axis geomagnetic sensor from Bosh Sensortec. Featuring the proprietary FlipCore technology from Bosch, low-power consumption, and noise, as well as thermally compensated measurements, this device is specially tuned and tailored to be used in demanding 3-axis mobile applications.
The BMM150 module is able to work in four power modes: Power Off mode, Suspend mode, Sleep mode and Active mode. The overall power consumption is greatly affected by the selection of power modes. All modes except the Power Off mode can be set by programming the appropriate registers. Additionally, while working in Active mode, the power consumption depends on the measurement rate, which can be either timed with the programmed output data rate (Normal mode) or forced by the user (Forced mode).
The sensor output noise is processed by the internal integrator, so setting more measurement repetitions for the same axis will yield output results with less noise. This also affects the overall power consumption in the Active mode.
There are four interrupt engines available on this device: low threshold, high threshold and overflow and data ready (DRDY). Every interrupt engine can be enabled independently. If the interrupt is enabled, it will set the corresponding status bit in the status register. For this interrupt to appear on the INT pin of the BMM150 IC, a corresponding bit should be set in the configuration register. This pin is routed to the mikroBUS INT pin and can be used for triggering external events. Data ready pin is not physically available on the Click Board™, but still, its status bit can be read from the status register.
The temperature compensation is based on a hall plate sensor measurement. This IC outputs raw values for the measurements: DATAX, DATAY, DATAZ, and RHALL. The data width for the X and Y axes is different than the one for the Z and RHALL. DATAX and DATAY data fields are 13 bits wide, while DATAZ field is 15 bits wide. RHALL data field is 14 bits wide. The manufacturer recommendation is to read all the axes at once. The output registers are refreshed all at once after all the measurements are finished. While reading registers, a new measurement is not stored in the same registers, but buffered to shadow registers, instead. This prevents axes data mixing, so it is also recommended to read the whole register sequence in one burst. To further control the data reading sequence, two additional bits are used to indicate the data ready status and data overrun status.
The GeoMagnetic Click Board™ can use either SPI or I2C communication interface. The selection between the interfaces can be done by switching the SMD jumper positions. There are two group of SMD jumpers. The first group is labelled as COM SEL and it is used to select the required interface type. It should be noted that all the jumpers need to be switched either left for SPI interface type or right for I2C interface type. Mixed positions are not allowed. The second group of SMD jumpers is labelled as ADD SEL and it is used to set the two least significant bits (LSB) of the I2C address. These jumpers are disregarded if the SPI interface is selected. More information about the registers and their settings can be found in the datasheet link, below.
The provided GeoMagnetic Click Board™ library offers simple and easy to use functions, which are demonstrated in the demo application. These functions allow easy and simple configuration management and data reading, speeding up the development process.
Specifications
Type | Compass,Magnetic |
Applications | The GeoMagnetic Click Board™ an easy to use and reliable solution for a rapid development of geomagnetic based applications |
On-board modules | BMM150 geomagnetic sensor from Bosch |
Key Features | Three-axis geomagnetic sensor |
Interface | GPIO,I2C,SPI |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V |
Pinout Diagram
This table shows how the pinout on GeoMagnetic Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | INT | Interrupt | |
SPI Chip Select | CS | 3 | CS | RX | 14 | NC | |
SPI Clock | SCK | 4 | SCK | TX | 13 | NC | |
SPI Data OUT | SDO | 5 | MISO | SCL | 12 | SCL | I2C Clock |
SPI Data IN | SDI | 6 | MOSI | SDA | 11 | SDA | I2C Data |
Power supply | +3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
GEOMAGNETIC CLICK SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
I2C Clock | 400 | kHz | ||
SPI Clock (SDI, SDO load < 25pF) | 10 | MHz |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
JP1 - JP5 | COM SEL | LEFT | Communication protocol selection: Left position - SPI, right position - I2C |
JP6 - JP7 | ADD SEL | LEFT | I2C Address selection: Left position - 0, right position - 1 |
LD1 | PWR | - | Power LED indicator |
Software Support
We provide a library for the GeoMagnetic Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Library Description
Initializes and defines the SPI and I2C bus driver and driver functions, which has the ability to write on registers and reading from registers. The functions also offer a choice of reading x, y, and z-axis data and hall resistance data when data is ready for reading. For more details check the documentation.
Key Functions
GEOMAG_RETVAL_T geomag_writeReg( uint8_t dataIn, const uint8_t registerAddress )
- The function writes one byte of data in the register.
GEOMAG_RETVAL_T geomag_readReg( uint8_t *dataOut, const uint8_t registerAddress, const uint8_t nBytes )
- The function reads the determined number of bytes from registers.
void geomag_readData( uint16_t *dataX, uint16_t *dataY, uint16_t *dataZ, uint16_t *resHall )
- The function reads 13-bit x and y-axis data, 15-bit z-axis data, and 14-bit hall resistance data from data registers.
Example Description
- The application is composed of three sections:
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes SPI driver, performs power-on reset and configures the device so that all channels (x, y, and z) is enabled and Data Ready bit is active on high (Data Ready bit must be configured that is active on high).
Application Task - (code snippet) - Reads axis data after each 500ms and logs results on USB UART.
void applicationTask() { geomag_readData( &axisX, &axisY, &axisZ, &RHall ); WordToStr( axisX, text ); mikrobus_logWrite( "X axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisY, text ); mikrobus_logWrite( "Y axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisZ, text ); mikrobus_logWrite( "Z axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); mikrobus_logWrite( "", _LOG_LINE ); Delay_ms( 500 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- SPI
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The GeoMagnetic Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Software Support
We provide a library for the GeoMagnetic Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Library Description
Initializes and defines the SPI and I2C bus driver and driver functions, which has the ability to write on registers and reading from registers. The functions also offer a choice of reading x, y, and z-axis data and hall resistance data when data is ready for reading. For more details check the documentation.
Key Functions
GEOMAG_RETVAL_T geomag_writeReg( uint8_t dataIn, const uint8_t registerAddress )
- The function writes one byte of data in the register.
GEOMAG_RETVAL_T geomag_readReg( uint8_t *dataOut, const uint8_t registerAddress, const uint8_t nBytes )
- The function reads the determined number of bytes from registers.
void geomag_readData( uint16_t *dataX, uint16_t *dataY, uint16_t *dataZ, uint16_t *resHall )
- The function reads 13-bit x and y-axis data, 15-bit z-axis data, and 14-bit hall resistance data from data registers.
Example Description
- The application is composed of three sections:
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes SPI driver, performs power-on reset and configures the device so that all channels (x, y, and z) is enabled and Data Ready bit is active on high (Data Ready bit must be configured that is active on high).
Application Task - (code snippet) - Reads axis data after each 500ms and logs results on USB UART.
void applicationTask() { geomag_readData( &axisX, &axisY, &axisZ, &RHall ); WordToStr( axisX, text ); mikrobus_logWrite( "X axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisY, text ); mikrobus_logWrite( "Y axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisZ, text ); mikrobus_logWrite( "Z axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); mikrobus_logWrite( "", _LOG_LINE ); Delay_ms( 500 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- SPI
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
MIKROSDK
The GeoMagnetic Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.