By detecting gravitational forces, accelerometers aid in determining an object's orientation with respect to Earth's gravitational field, providing valuable information for navigation and alignment applications
A
A
Hardware Overview
How does it work?
Accel 11 Click is based on the BMA456, a digital triaxial acceleration sensor from Bosch Sensortec. This sensor has many features ideally suited for wearables, handheld, and IoT applications, offering a good balance between the performance and the power consumption. One of its key features is its extremely low power consumption, which makes it perfectly suited for such applications. There are several power modes that the BMA456 device can use. While in Low Power mode, the device consumes the least power, but access to some features is restricted. More information can be found within the BMA456 datasheet. The BMA456 sensor can measure acceleration within ranges of ±2 g, ±4 g, ±8, and ±16 g. It can output the measurement data using the Output Data Rate (ODR) from 0.78Hz (Low Power mode) up to 1600Hz (Performance mode). A high-precision analog front end facilitates highly sensitive MEMS, featuring a 16-bit A/D Converter. It allows very high output accuracy, even during low amplitude changes. This makes the sensor particularly sensitive and accurate with movements that
generate relatively low acceleration signals. However, using a highly sensitive MEMS makes the BMA456 prone to damage caused by extremely high g-forces (10,000g for less than 200µs). Acceleration data is available in 16-bit format from the data registers and the internal FIFO buffer of 1kb. The FIFO buffer can be used for more complex calculations or timed readings, reducing the traffic on the communication interface. The interrupt engine facilitates the FIFO buffer, triggering an interrupt for two FIFO events: the watermark event and the FIFO buffer full event. FIFO buffer allows optimization within the firmware that runs on the host MCU. Besides the acceleration MEMS and complementary analog front-end circuit, the BMA456 sensor has an integrated temperature sensor. It is updated every 1.2s and sampled to an 8-bit value (complement of 2’s format). Interrupts can be triggered for many different events. Some basic events include the data-ready interrupt event and aforementioned FIFO events, while so-called feature engines can trigger an interrupt for any of the detected
motion/movement events, including step detection/counter, activity recognition, tilt on the wrist, tap/double tap, any/no motion, and error event interrupt. The extensive interrupt engine can use two programmable interrupt pins. Depending on settings in appropriate registers, these pins can be assigned with any interrupt source and can be either LOW or HIGH on interrupt. These two pins are routed to the INT and AN pin of the mikroBUS™ and are labeled IT1 and IT2, respectively. Accel 11 click offers two communication interfaces. It can be used with either I2C or SPI. The onboard SMD jumpers labeled COMM SEL allow switching between the two interfaces. Note that all the jumpers must be positioned in the I2C or SPI position. When the I2C interface is selected, an additional SMD jumper labeled ADDR SEL becomes available, determining the least significant bit of the BMA456 I2C address. The Click board™ should be interfaced only with MCUs that use logic levels of 3.3V.
Features overview
Development board
Fusion for STM32 v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 32-bit ARM® Cortex®-M based MCUs from STMicroelectronics, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for STM32 v8 provides a fluid and immersive working experience, allowing
access anywhere and under any circumstances at any time. Each part of the Fusion for STM32 v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for STM32 v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
![default](https://cdn.mikroe.com/rent-a-product/request-setup/mcu-cards/mcu-card-11-for-stm32-stm32f302vc.png)
Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
256
Silicon Vendor
STMicroelectronics
Pin count
100
RAM (Bytes)
40960
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
![Accel 11 Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee79092-9c4d-6db2-9fb9-0242ac120009/schematic.webp)
Step by step
Project assembly
Track your results in real time
Application Output
After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.
![UART Application Output Step 1](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-40a0-6b58-88de-02420a00029a/UART-AO-Step-1.jpg)
Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.
![UART Application Output Step 2](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-eb29-62fa-ba91-02420a00029a/UART-AO-Step-2.jpg)
In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".
![UART Application Output Step 3](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703b-7543-6fbc-9c69-0242ac120003/UART-AO-Step-3.jpg)
The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
![UART Application Output Step 4](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703c-068c-66a4-a4fc-0242ac120003/UART-AO-Step-4.jpg)
Software Support
Library Description
This library contains API for Accel 11 Click driver.
Key functions:
accel11_get_axis_data
- This function reads accel axisaccel11_test_comunication
- This function test comunicationaccel11_power_on_procedure
- This function for power on chip
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Accel11 Click example
*
* # Description
* This demo application reads X / Y / Z axis acceleration data.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initialization device.
*
* ## Application Task
* Reads X / Y / Z axis acceleration data and it logs to USBUART every 1500ms.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "accel11.h"
// ------------------------------------------------------------------ VARIABLES
static accel11_t accel11;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
uint8_t tmp;
log_cfg_t log_cfg;
accel11_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
accel11_cfg_setup( &cfg );
ACCEL11_MAP_MIKROBUS( cfg, MIKROBUS_1 );
accel11_init( &accel11, &cfg );
tmp = accel11_test_comunication( &accel11 );
if ( tmp == ACCEL11_TEST_COMUNICATION_OK )
{
log_printf( &logger, " Comunication OK !!!\r\n" );
}
else
{
log_printf( &logger, " Comunication ERROR !!!\r\n" );
for ( ; ; );
}
accel11_default_cfg( &accel11 );
}
void application_task ( void )
{
int16_t x_axis;
int16_t y_axis;
int16_t z_axis;
x_axis = accel11_get_axis_data( &accel11, ACCEL11_ACCEL_X_AXIS );
log_printf( &logger, " X axis : %d\r\n", x_axis );
y_axis = accel11_get_axis_data( &accel11, ACCEL11_ACCEL_Y_AXIS );
log_printf( &logger, " Y axis : %d\r\n", y_axis );
z_axis = accel11_get_axis_data( &accel11, ACCEL11_ACCEL_Z_AXIS );
log_printf( &logger, " Z axis : %d\r\n", z_axis );
log_printf( &logger, "---------------------------------\r\n" );
Delay_ms( 1500 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END