/dm-mcx-accel-and-pressure-monitor

This demo shows how to integrate the NXP sensors FXLS8974CF (3-axis accelerometer) and MPL3115 (absolute pressure) with FRDM-MCXN947 platform. Both sensors share the I2C bus of the Accel & Pressure click board, that is used in the demo for digital communication between the MCXN947 and the sensors.

Primary LanguageCOtherNOASSERTION

NXP Application Code Hub

Multi sensor demo with FRDM-MCXN947 and LDC-PAR-S035

This demo shows how to integrate the NXP sensors FXLS8974CF (3-axis accelerometer) and MPL3115 (absolute pressure) with FRDM-MCXN947 platform. Both sensors share the I2C bus of the Accel & Pressure click board, that is used in the demo for digital communication between the MCXN947 and the sensors.

The demo uses the LVGL graphics framework and a TFT Display (LCD-PAR-S035) to show sensor data. The GUI shows a multi-Tab menu that allows the user to:

  • Monitor the 3-axis accelerometer measurements.
  • Monitor the pressure sensor measurements in Pascals.
  • Watch a live chart with the latest 40 points of the 3-axis accelerometer.

The GUI was designed with GUI Guider (NXP).

  • Boards: FRDM-MCXN947

  • Accessories: mikroe_accel_pressure_click

  • Categories: Graphics, HMI, Sensor

  • Peripherals: DISPLAY, I2C, SENSOR, GPIO, UART

  • Toolchains: MCUXpresso IDE

Table of Contents

  1. Software
  2. Hardware
  3. Setup
  4. Results
  5. Support

1. Software

2. Hardware

For this demo you will need the next hardware.

Alt text

Alt text

Alt text

  • Personal Computer
  • Mini/micro C USB cable

3. Setup

The following instructions are based on MCUXpresso IDE. However, similar steps can be followed for VS Code. Example includes linker files that allows demo to be imported and converted.

3.1 Step 1: Connect Display to FRDM-MCXN947

Check that the switch SW1 In the LCD is set to 010 (16bits 8080) and plug-in the LCD in the board (use the next image like reference) you should connect the LCD in the J8 header with two pins free in the top of the header.

Alt text

3.2 Step 2: Connect Accel & Pressure click board atop FRDM-MCXN947

Plug-in the Accel & Pressure click board (mikroe) atop the native mikroe slot of the FRDM board.
Then plug-in the USB cable between the host PC and the FRDM-MCXN947.
See the figure below for reference.

Alt text

3.3 Step 3: Download and Install required Software(s)

3.4 Step 4: Build demo project

  • Open MCUXpresso IDE and select a directory to create your workspace.
  • Install "MCXUpresso SDK 2.14.0 for FRDM-MCXN947" (drag and drop SDK zip into "Installed SDK" view) into MCUXpresso IDE.
  • Go to "Quickstart Panel" and click on "Import from Application Code Hub".

    Alt text

  • Enter "Accel and Pressure sensor demo" in search bar. Select project card.
  • Click "GitHub link" within wizard to copy github information into IDE wizard.

    Alt text

  • Continue to follow the default steps of the Wizard. Click Next, Click Next for "main" branch.
  • Select the desired destination to store the imported project. Initial branch = main. Click Next.
  • Click next to select the discovered Eclipse projects.
  • Click Finish to complete the import into workspace.

    Alt text

  • Right click on project and select build to start building the project.

4. Results

The demo will start running inmediately after the FW is downloaded to the target from MCUXpresso.
The GUI shows the Accel. panel by default. It will show acceleration measurements coming from the 3-axis accelerometer (FXLS8974CD), note that the vector magnitude is also shown.
The user can easily switches to another tab by tapping, for example to visualize the pressure subjected to the MPL3115 sensor.
The third tab "chart" shows the latest collected 40 samples for the three axis of the accel.
The figure below shows the demo running...
Alt text

5. Support

Project Metadata

Board badge

Category badge

Peripheral badge Peripheral badge Peripheral badge Peripheral badge Peripheral badge

Toolchain badge

Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.

Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected funcionality, enter your questions on the NXP Community Forum

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

7. Release Notes

Version Description / Update Date
1.0 Initial release on Application Code Hub May 17th 2024