Master the art of movement with our 3-axis accelerometer, where the future of precision opens doors to applications that demand accuracy and reliability
A
A
Hardware Overview
How does it work?
Accel 25 Click is based on the MXC4005XC, a highly reliable digital triaxial acceleration from MEMSIC. The MXC4005XC is highly configurable with a programmable acceleration range of ±2g, ±4g, or ±8g based on MEMSIC's proprietary thermal technology built with a 0.18μm standard CMOS process. It contains no moving sensor parts, eliminating field reliability and repeatability issues; no measurable resonance (immunity to vibration), stiction, or detectable hysteresis exists. The MXC4005XC also eliminates the "click" sounds typically heard in ball-based orientation sensors.
The shock survival of this MEMS sensing structure is greater than 200,000g. This sensor provides X/Y/Z axis acceleration signals with a low 0g offset and temperature signals with high accuracy. In addition, it also detects six orientation positions, X/Y shake, and shakes directions. Accel 25 Click communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings capable of operating in a standard or fast mode of operation. The acceleration signal is provided in 12-bit output resolution. In addition to communication pins, this board also possesses an
additional interrupt pin, routed to the INT pin on the mikroBUS™ socket, for orientation and X/Y shake detections. The MXC4005XC allows users to be placed in a Power-Down mode enabled through the I2C 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
Curiosity PIC32 MZ EF development board is a fully integrated 32-bit development platform featuring the high-performance PIC32MZ EF Series (PIC32MZ2048EFM) that has a 2MB Flash, 512KB RAM, integrated FPU, Crypto accelerator, and excellent connectivity options. It includes an integrated programmer and debugger, requiring no additional hardware. Users can expand
functionality through MIKROE mikroBUS™ Click™ adapter boards, add Ethernet connectivity with the Microchip PHY daughter board, add WiFi connectivity capability using the Microchip expansions boards, and add audio input and output capability with Microchip audio daughter boards. These boards are fully integrated into PIC32’s powerful software framework, MPLAB Harmony,
which provides a flexible and modular interface to application development a rich set of inter-operable software stacks (TCP-IP, USB), and easy-to-use features. The Curiosity PIC32 MZ EF development board offers expansion capabilities making it an excellent choice for a rapid prototyping board in Connectivity, IOT, and general-purpose applications.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output
After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.
After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.
Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.
Software Support
Library Description
This library contains API for Accel 25 Click driver.
Key functions:
accel25_soft_reset
- Accel 25 soft reset functionaccel25_set_full_scale_range
- Accel 25 set full scale range functionaccel25_read_data
- Accel 25 read data 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 25 Click example
*
* # Description
* This example demonstrates the use of Accel 25 click board by reading and displaying
* accel data (X, Y, and Z axis) as well as temperature measurements on the USB UART.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration.
*
* ## Application Task
* Reads and displays the accel data (X, Y, and Z axis) as well as temperature measurements
* on the USB UART every 100ms approximately.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "accel25.h"
static accel25_t accel25;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
accel25_cfg_t accel25_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.
accel25_cfg_setup( &accel25_cfg );
ACCEL25_MAP_MIKROBUS( accel25_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == accel25_init( &accel25, &accel25_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( ACCEL25_ERROR == accel25_default_cfg ( &accel25 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
accel25_data_t meas_data;
// Wait for data ready indication
if ( ACCEL25_PIN_STATE_LOW == accel25_get_int_pin ( &accel25 ) );
{
if ( ACCEL25_OK == accel25_read_data ( &accel25, &meas_data ) )
{
log_printf( &logger, " X: %.3f g\r\n", meas_data.x );
log_printf( &logger, " Y: %.3f g\r\n", meas_data.y );
log_printf( &logger, " Z: %.3f g\r\n", meas_data.z );
log_printf( &logger, " Temperature: %.2f degC\r\n", meas_data.temperature );
}
Delay_ms ( 100 );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END