Unlock precise vertical velocity insights and determine your application's exact rate of ascent or descent
A
A
Hardware Overview
How does it work?
Accel&Pressure Click is based on the FXLS8974CF, a 3-axis low-g accelerometer, and the MPL3115A2, a precision pressure sensor with altimetry, both from NXP Semiconductor. The accelerometer has a ±2/4/8/16 g user-selectable, full-scale measurement range with a 12-bit acceleration data output. It can work in several modes, such as active, hibernate, standby, and more. The integrated FIFO/LIFO buffer of 144 bytes can store 32 12-bit X/Y/Z/ data triplets. The sensor also has flexible data change detection, such as motion, freefall, and other inertial events. The pressure sensor has an absolute operating range of
20kPa to 110kPa in 20-bit measurements. Besides the pressure, the MPL3115A2 can also measure the altitude in a range of -698 up to 11775 meters in a 20-bit resolution. It also comes with an embedded FIFO (32 samples) and up to 12 days of data logging using the FIFO. Both sensors have an integrated temperature sensor and are temperature-compensated. Accel&Pressure Click uses a standard 2-wire I2C interface to allow the host MCU to communicate with both sensors. If the motion is detected, the FXLS8974CF uses a motion MOT pin to interrupt the host MCU. Depending on your application, you can choose one of the
available pins (PWM, AN, CS) by soldering one of the jumpers (R8, R9, R10) to control the hibernation mode wake-up function of the FXLS8974CF. In addition, there are LP Cut jumpers at the bottom of the Accel&Pressure Click board™, with which a low power consumption feature can be achieved. 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
PIC32MZ Clicker is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller with FPU from Microchip, a USB connector, LED indicators, buttons, a mikroProg connector, and a header for interfacing with external electronics. Thanks to its compact design with clear and easy-recognizable silkscreen markings, it provides a fluid and immersive working experience, allowing access anywhere and under
any circumstances. Each part of the PIC32MZ Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the PIC32MZ Clicker programming method, using USB HID mikroBootloader, or through an external mikroProg connector for PIC, dsPIC, or PIC32 programmer, the Clicker board also includes a clean and regulated power supply module for the development kit. The USB Micro-B connection can provide up to 500mA of current, which is more than enough to operate all onboard
and additional modules. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several buttons and LED indicators. PIC32MZ Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping 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://dbp-cdn.mikroe.com/catalog/mcus/resources/PIC32MZ1024EFH064/PIC32MZ1024EFH064.jpg)
Architecture
PIC32
MCU Memory (KB)
1024
Silicon Vendor
Microchip
Pin count
64
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
![Accel&Pressure Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1eeb5354-9fb4-661c-95da-02420a0002c0/Accel-Pressure-Click-v100-Schematic-1.png)
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.
![Application Output Step 1](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed554e-d80f-6694-8cb9-02420a000272/AP-Step1.jpg)
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™.
![Application Output Step 3](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed5550-3c0f-6800-a19f-02420a000272/AP-Step3.jpg)
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.
![Application Output Step 4](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed5550-d4d0-6b20-a348-02420a000272/AP-Step4.jpg)
Software Support
Library Description
This library contains API for Accel&Pressure Click driver.
Key functions:
accelpressure_get_axes_data
- This function reads the accelerometer sensor axes data.accelpressure_get_pressure
- This function reads the sensor pressure data conversion in mbar.accelpressure_get_temperature
- This function reads the conversion of sensor pressure data in degrees Celsius.
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 AccelPressure Click example
*
* # Description
* This library contains API for the AccelPressure Click driver.
* The library initializes and defines the I2C drivers to
* write and read data from registers, as well as the default configuration
* for the reading accelerator, pressure, and temperature data.
*
* The demo application is composed of two sections :
*
* ## Application Init
* The initialization of the I2C module, log UART, and additional pins.
* After the driver init, the app executes a default configuration.
*
* ## Application Task
* This example demonstrates the use of the AccelPressure Click board.
* Measures and displays acceleration data for the X-axis, Y-axis, and Z-axis [mg],
* pressure [mBar], and temperature [degree Celsius] data.
* Results are being sent to the UART Terminal, where you can track their changes.
*
* @author Nenad Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "accelpressure.h"
static accelpressure_t accelpressure;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
accelpressure_cfg_t accelpressure_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.
accelpressure_cfg_setup( &accelpressure_cfg );
ACCELPRESSURE_MAP_MIKROBUS( accelpressure_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == accelpressure_init( &accelpressure, &accelpressure_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( ACCELPRESSURE_ERROR == accelpressure_default_cfg ( &accelpressure ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
log_printf( &logger, "_________________\r\n" );
}
void application_task ( void )
{
accelpressure_axes_t acc_axis;
float pressure = 0, temperature = 0;
if ( ACCELPRESSURE_OK == accelpressure_get_axes_data( &accelpressure, &acc_axis ) )
{
log_printf( &logger, " Accel X: %.2f mg\r\n", acc_axis.x );
log_printf( &logger, " Accel Y: %.2f mg\r\n", acc_axis.y );
log_printf( &logger, " Accel Z: %.2f mg\r\n", acc_axis.z );
}
log_printf( &logger, "_________________\r\n" );
Delay_ms( 100 );
if ( ACCELPRESSURE_OK == accelpressure_get_pressure( &accelpressure, &pressure ) )
{
log_printf( &logger, " Pressure: %.2f mbar\r\n", pressure );
}
Delay_ms( 100 );
if ( ACCELPRESSURE_OK == accelpressure_get_temperature( &accelpressure, &temperature ) )
{
log_printf( &logger, " Temperature: %.2f mbar\r\n", temperature );
}
log_printf( &logger, "_________________\r\n" );
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END