Turn raw motion data into valuable insights for your applications
A
A
Hardware Overview
How does it work?
Accel 28 Click is based on the LIS2HH12TR, an ultra-low-power, high-performance three-axis accelerometer from STMicroelectronics. The sensing element is made of a suspended silicone structure anchored in a few points and free to move toward the sensed acceleration. If there is an acceleration, the proof mass is displaced from its normal position and causes an imbalance in the capacitive half-bridge, which is measured. The whole measurements are on the values of internal capacitors. The values are outputted as 16-bit data. The sensor features extreme robustness with 10000g of high shock survivability. It also has an embedded temperature sensor for temperature compensation and a self-test. The self-test capability allows the user to check the functioning of the sensor in the final application. The sensor is
already factory-calibrated. The FIFO buffer of the LIS2HH12TR sensor works in several modes. Bypass mode bypasses the FIFO and is used to reset the FIFO when in FIFO mode. In FIFO mode, the sensor stores data from all three channels in the FIFO buffer. Stream mode provides continuous FIFO updates; the older data is discarded as new data arrives. There are additional modes: Stream-to-FIFO, Bypass-to-Stream, Bypass-to-FIFO, Retrieving data from FIFO, and Burst. The Burst mode allows multiple reads to be performed. Accel 28 Click allows the use of both I2C and SPI interfaces with a maximum frequency of 400KHz for I2C and 10MHz for SPI communication. The selection can be made by positioning SMD jumpers labeled as COMM SEL in an appropriate position. Note that all the jumpers' positions must
be on the same side, or the Click board™ may become unresponsive. While the I2C interface is selected, the LIS2DTW12 allows choosing the least significant bit (LSB) of its I2C slave address using the SMD jumper labeled ADDR SEL. The Accel 28 also possesses two interrupt pins, both routed to the INT pin on the mikroBUS™ socket over the INT SEL jumper (default INT1). These interrupt pins signal MCU that the user has sensed an event entirely through the I2C/SPI interface. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
Fusion for TIVA 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 Texas Instruments, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over a WiFi network. 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 TIVA v8 provides a fluid and immersive working experience, allowing access
anywhere and under any circumstances at any time. Each part of the Fusion for TIVA 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 TIVA 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
Type
8th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
256
Silicon Vendor
Texas Instruments
Pin count
100
RAM (Bytes)
32768
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for Accel 28 Click driver.
Key functions:
accel28_get_data
- Accel 28 data reading function.accel28_write_reg
- Accel 28 register data writing function.accel28_sw_reset
- Accel 28 SW reset function.
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 main.c
* @brief Accel 28 Click example
*
* # Description
* This example demonstrates the use of Accel 28 click board by reading and
* displaying the accelerometer data (X, Y, and Z axis).
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver, performs the click default configuration.
*
* ## Application Task
* Reads and displays on the USB UART the accelerometer data (X, Y, and Z axis)
* when it is available.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "accel28.h"
static accel28_t accel28;
static log_t logger;
accel28_data_t accel_data;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
accel28_cfg_t accel28_cfg; /**< Click config object. */
/**
* 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.
accel28_cfg_setup( &accel28_cfg );
ACCEL28_MAP_MIKROBUS( accel28_cfg, MIKROBUS_1 );
err_t init_flag = accel28_init( &accel28, &accel28_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
uint8_t id_data = 0;
accel28_generic_read( &accel28, ACCEL28_REG_WHO_AM_I, &id_data, 1 );
if ( ACCEL28_WHO_AM_I_VALUE != id_data )
{
log_error( &logger, " Communication error." );
for ( ; ; );
}
if ( ACCEL28_ERROR == accel28_default_cfg ( &accel28 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
err_t error_flag = ACCEL28_OK;
if ( ACCEL28_PIN_STATE_HIGH == accel28_get_int_state( &accel28 ) )
{
uint8_t tmp_data;
error_flag = accel28_read_reg( &accel28, ACCEL28_REG_STATUS, &tmp_data );
if ( ( tmp_data & ACCEL28_STATUS_ZYX_DATA_AVL ) && ( ACCEL28_OK == error_flag ) )
{
error_flag = accel28_get_data( &accel28, &accel_data );
if ( ACCEL28_OK == error_flag )
{
log_printf( &logger, " X-axis %.2f mg\r\n", accel_data.x_data );
log_printf( &logger, " Y-axis %.2f mg\r\n", accel_data.y_data );
log_printf( &logger, " Z-axis %.2f mg\r\n", accel_data.z_data );
log_printf( &logger, " = = = = = = = = = = = = = =\r\n" );
}
}
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END