Wiki

This version (27 Sep 2022 17:20) was approved by Darius B.The Previously approved version (18 May 2022 15:57) is available.Diff

Evaluating the ADXL355

Supported Evaluation Boards

EVAL-ADXL355-PMDZ Overview

The PMOD compatible evaluation/prototyping board is a small form factor, low cost, low noise, and low drift, 3-axis accelerometer sensor measurement board.

SPI PMOD peripheral connectors can be found on many 3rd party MCU or FPGA development boards, where the EVAL-ADXL355-PMDZ can be connected directly into those systems.

Hardware Specifications

Power Supply Requirements

The ADXL355 PMOD board has to be supplied with 3.3V power. If using directly with a PMOD connector, the host board should be capable of providing the 3.3V supply.

Digital Interface (PMOD)

The PMOD interface is a series of standardized digital interfaces for various digital communication protocols such as SPI, I2C, and UART. These interface types were standardized by Digilent, which is now a division of National Instruments. Complete details on the PMOD specification can be found here.

The specific interface used for the EVAL-ADXL355-PMDZ boards is the extended SPI. In general ADI has adopted the extended SPI connector for all PMOD devices which have an SPI interface. It provides flexibility to add interrupts, general purpose I/O, resets, and other important digitally controlled functions.

P1 Pin Number Pin Function Mnemonic
Pin 1 Chip Select CS
Pin 2 Master Out Slave In MOSI
Pin 3 Master In Slave Out MISO
Pin 4 Serial Clock SCLK
Pin 5 Digital Ground DGND
Pin 6 Digital Power VDD
Pin 7 Interrupt 1 INT1
Pin 8 Not Connected NC
Pin 9 Interrupt 2 INT2
Pin 10 Data Ready DRDY
Pin 11 Digital Ground DGND
Pin 12 Digital Power VDD

ADI No-OS

The goal of ADI Microcontroller No-OS is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. ADI No-OS offers generic drivers which can be used as a base for any microcontroller platform and also example projects which are using these drivers on various microcontroller platforms.

For more information about ADI No-OS and supported microcontroller platforms see: no-OS

ADXL355 Driver

Information about the ADXL355 driver can be found here: ADXL355 driver

No-OS Supported Platforms

STM32 Platform

Hardware Setup

Required Hardware
Required Connections

The SDP-K1, does not have a PMOD interface, but you may use Dupont male-female cables to make the required connections. The following table shows how the connection between EVAL-ADXL355-PMDZ and SDP-K1 is realized in this project example.

P1 EVAL-ADXL355-PMDZ Pin Number SDP-K1 Pin Number Function Mnemonic
Pin 1 DIGITAL 10 Chip Select CS
Pin 2 DIGITAL 11 Master Out Slave In MOSI
Pin 3 DIGITAL 12 Master In Slave Out MISO
Pin 4 DIGITAL 13 Serial Clock SCLK
Pin 5 DIGITAL GND Digital Ground DGND
Pin 6 POWER 3.3V Digital Power VDD
Pin 10 ANALOG IN A0 Data Ready DRDY

Make sure that the VIO_ADJUST is set to 3.3V on SDP-K1.

Maxim Platform

Hardware Setup

Required Hardware
Required Connections

The MAX32655 does not have a PMOD interface, but you may use Dupont male-female cables to make the required connections. The following table shows how the connection between EVAL-ADXL355-PMDZ and MAX32655 is realized in this project example.

P1 EVAL-ADXL355-PMDZ Pin Number MAX32655 Pin Number Function Mnemonic
Pin 1 SS0 Chip Select CS
Pin 2 MOSI Master Out Slave In MOSI
Pin 3 MISO Master In Slave Out MISO
Pin 4 SCLK Serial Clock SCLK
Pin 5 GND Digital Ground DGND
Pin 6 POWER 3.3V Digital Power VDD
Pin 10 P1_9 Data Ready DRDY

No-OS Build Setup

No-OS Clone

NOTE: This build guide is valid for the projects found in the no-OS/projects folder. If your project resides elsewhere under the no-OS repository tree, it is a legacy project. A build guide for legacy projects can be found Build no-OS with GNU make.

Clone NO-OS with the --recursive flag:

git clone --recursive https://github.com/analogdevicesinc/no-OS

If however you've already cloned NO-OS without the --recursive flag, you may initialize all the submodules in an existing NO-OS clone with:

git submodule update --recursive --init

→ Read more...

No-OS Build Prerequisites

Please follow the steps below for No-OS Setup based on the environment you are using. Make sure you use the information for the specific platform you are using (e.g. STM32, MAXIM).

Prior to building a no-OS project, it is required to set up some environment variables so that the build process may find the necessary tools (compiler, linker, SDK etc.).

Use the following commands to prepare your environment for building no-OS projects:

Linux (Click to expand)

Linux (Click to expand)

Intel (Click to expand)

Intel (Click to expand)

Assuming the SDK is installed at this path:

/path/to/intel
└── intelFPGA
    └── 18.1

Run:

$ source no-OS/tools/scripts/platform/intel/environment.sh /path/to/intel/intelFPGA 18.1

Xilinx (Click to expand)

Xilinx (Click to expand)

Assuming the Vitis is installed at this path:

/path/to/xilinx
├── DocNav
├── Downloads
├── SDK
│   └── 2019.1
└── Vitis
    └── 2021.1

When using no-OS master branch, run:

$ source /path/to/xilinx/Vitis/2021.1/settings64.sh

When using no-OS 2019_R2 branch, run:

$ source /path/to/xilinx/SDK/2019.1/settings64.sh

For more information, consult the support/answers/47821.html.

STM32 (Click to expand)

STM32 (Click to expand)

  • Install stm32cubeide to default location /opt/stm32cubeide. If you'd rather install it at a different location, run export STM32CUBEIDE=/path/to/your/stm32cubeide in the terminal used for building.
  • Install stm32cubemx to default location /opt/stm32cubemx. If you'd rather install it at a different location, run export STM32CUBEMX=/path/to/your/stm32cubemx in the terminal used for building.
  • Install java (openjdk-11), sed and head (if not already present, they normally are).

Maxim (Click to expand)

Maxim (Click to expand)

  • Install the Maxim Micros SDK.
  • Set the MAXIM_LIBRARIES environment variable to the MaximSDK/Libraries path (the default should be ~/MaximSDK/Libraries).
  • For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

Pico (Click to expand)

Pico (Click to expand)

  • Set the PICO_SDK_PATH environment variable to the pico-sdk cloned repository path.
  • Install the J-Link software
  • Set the JLINK_SERVER_PATH environment variable to the JLinkGDBServerCLExe path (the default path should be /opt/SEGGER/JLink/JLinkGDBServerCLExe).
  • For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

Please install all the necessary packs locally and then manually import them in CrossCore

Common Issues with environment setup:

  • Makefiles searches for the CCES_HOME in its default installation directory. It may happen that multiple version are installed and may not work. To select a CCES_HOME run export CCES_HOME=/opt/analog/cces/2.10.0

Windows (Click to expand)

Windows (Click to expand)

Use cmd or PowerShell. Cygwin is not supported.

Intel (Click to expand)

Intel (Click to expand)

Assuming the SDK is installed at this path:

C:\
└── intelFPGA
    └── 18.1

Run:

> .\no-OS\tools\scripts\platform\altera\environment.bat C:\intelFpga 18.1

Xilinx (Click to expand)

Xilinx (Click to expand)

Assuming the Vitis is installed at this path:

C:\Xilinx
├── DocNav
├── Downloads
├── SDK
│   └── 2019.1
└── Vitis
    └── 2021.1

When using no-OS master branch, run:

> C:\Xilinx\Vitis\2021.1\settings64.bat

When using no-OS 2019_R2 branch, run:

> C:\Xilinx\SDK\2019.1\settings64.bat

For more information, consult the Xilinx support support/answers/47821.html.

Note that Xilinx SDK versions 2018.3 or earlier don't properly set up the Windows PATH so that you may use make command provided with the SDK from the shell.

If this is the case, please manually add the following to your Windows PATH or install make for Windows of your choice:

C:\Xilinx\SDK\2018.3\gnuwin\bin

Maxim (Click to expand)

Maxim (Click to expand)

  • Install the Maxim Micros SDK.
  • Set the MAXIM_LIBRARIES environment variable to the MaximSDK\Libraries path (the default should be C:\MaximSDK\Libraries).
  • For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

Please install all the necessary packs locally and then manually import them in CrossCore

Common Issues with environment setup:

  • Makefiles searches for the CCES_HOME in its default installation directory. It may happen that multiple version are installed and may not work. To select a CCES_HOME run set CCES_HOME=c:\Analog Devices\CrossCore Embedded Studio 2.10.0
If using PowerShell instead of cmd, open another shell instance after running the above scripts.

No-OS Build Project

The path of the project is no-OS/projects/eval-adxl355-pmdz/

Go in the project directory that should be built.

Linux (Click to expand)

Linux (Click to expand)

$ cd no-OS/projects/project_name/
$ tree
.
├── builds.json
├── Makefile
├── src
└── src.mk

Intel (Click to expand)

Intel (Click to expand)

Copy the .sof and .sopcinfo to the project folder.

$ ls
Makefile  profiles  src  src.mk  system_bd.sopcinfo  adrv9009_a10gx.sof	
$ make

# Alternatively you may select a .sopcinfo file explicitly by:
$ make HARDWARE=path/to/system_bd.sopcinfo

Xilinx (Click to expand)

Xilinx (Click to expand)

Copy the .hdf in the project folder.

$ ls
Makefile  profiles  src  src.mk system_top.hdf
$ make

# Alternatively you may select an .hdf file explicitly by:
$ make HARDWARE=path/to/file.hdf

Maxim (Click to expand)

Maxim (Click to expand)

To build a project, type:

make PLATFORM=maxim TARGET=...

The TARGET specifies the chip for which the project is built. If it is missing, max32660 will be used. At the moment, the available targets are: max32650, max32655 and max32660.

Pico (Click to expand)

Pico (Click to expand)

To build a project, type:

make PLATFORM=pico

STM32 (Click to expand)

STM32 (Click to expand)

Make sure you have the .ioc file in the project directory, then type:

$ make

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

The ADuCM3029 projects also contain a pinmux_config.c file which contains pin configuration instructions.

# build an ADuCM3029-only project
$ make

# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM
$ make PLATFORM=aducm3029

Windows (Click to expand)

Windows (Click to expand)

CMD needs to be run with administrative privileges to create a project.

If this is not possible, check the standalone section.

> cd .\no-OS\projects\project_name\

It should contain make-related files and source files:

.\no-OS\projects\project_name\
├── builds.json
├── Makefile
├── src
└── src.mk

Intel (Click to expand)

Intel (Click to expand)

Copy the .sof and .sopcinfo to the project folder and run:

.\no-OS\projects\adrv9009\
├── Makefile
├── profiles
├── src
├── src.mk
├── system_bd.sopcinfo
└── adrv9009_a10gx.sof

> make

Xilinx (Click to expand)

Xilinx (Click to expand)

Copy the .hdf to the project folder and run:

.\no-OS\projects\adrv9009\
├── Makefile
├── profiles
├── src
├── src.mk
└── system_top.hdf

> make

Maxim (Click to expand)

Maxim (Click to expand)

To build a project, type:

make PLATFORM=maxim TARGET=...

The TARGET specifies the chip for which the project is built. If it is missing, max32660 will be used. At the moment, the available targets are: max32650, max32655 and max32660.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

The ADuCM3029 projects also contain a pinmux_config.c file which contains pin configuration instructions.

# build an ADuCM3029-only project
> make

# if the platform autodetection picks the wrong platform, explicitly specify the PLATFORM
> make PLATFORM=aducm3029

The build process creates a build directory in the project folder:

build
├── app
├── bsp
├── obj
├── release.elf
└── tmp

Debug

Once the .elf or .hex file has been generated, make sure the board is powered on, JTAG cable connected and use the following commands to upload the program to the board or debug.

Uploading the binary to target is generically achieved with:

$ make run

Use the following command to launch the SDK associated to the used platform in order to be able to debug graphically by clicking the debug button:

$ make sdkopen

Fore more details about the available make rules, check out this page.

Example Project Execution

Dummy Project

Makefile Selection

In order to build the dummy project make sure you have the following configuration in the Makefile:

# Select the example you want to enable by choosing y for enabling and n for disabling
DUMMY_EXAMPLE = y
IIO_EXAMPLE = n

When running make command make sure to specify the platform you want to build the project for.

Project Description

The dummy project contains the generic HAL initialization of the used platform, together with the SPI and UART driver configuration and initialization.

The SPI driver is used to communicate with the EVAL-ADXL355-PMDZ device, while the UART driver is used to display on the host machine the measured data.

The dummy project contains the ADXL355 driver initialization in SPI mode:

struct adxl355_dev *adxl355;
struct adxl355_init_param init_data_adxl355 = {
	.comm_init.spi_init = sip,
	.comm_type = ADXL355_SPI_COMM,
};
ret = adxl355_init(&adxl355, init_data_adxl355);
if (ret < 0)
	goto error;

Some APIs are called in order to configure the ADXL355 device, after the initialization is performed. First of all, a soft reset is performed such that the device is put in a known state.

ret = adxl355_soft_reset(adxl355);
if (ret < 0)
	goto error;

After this, the sampling frequency and the operation mode is selected such that temperature measurements are also available.

// Set sampling frequency
ret = adxl355_set_odr_lpf(adxl355, ADXL355_ODR_3_906HZ);
if (ret < 0)
	goto error;

// Set operation mode
ret = adxl355_set_op_mode(adxl355, ADXL355_MEAS_TEMP_ON_DRDY_OFF);
if (ret < 0)
	goto error;

At this point the device is already performing measurements which are accessed continuously in a while loop at each second.

while(1) {
	pr_info("Single read \n");
        // Perform a single acceleration data read on all 3 axis from the device
	ret = adxl355_get_xyz(adxl355,&x[0], &y[0], &z[0]);
	if (ret < 0)
		goto error;
        // Print the obtained data
	pr_info(" x=%d"".%09u", (int)x[0].integer, (abs)(x[0].fractional));
	pr_info(" y=%d"".%09u", (int)y[0].integer, (abs)(y[0].fractional));
	pr_info(" z=%d"".%09u \n", (int)z[0].integer,(abs)(z[0].fractional));

        // Perform a FIFO reading (will read all the available data in the FIFO)
	ret = adxl355_get_fifo_data(adxl355, &fifo_entries, &x[0], &y[0], &z[0]);
	if (ret < 0)
		goto error;
        // Print the number of read entries from the FIFO
	pr_info("Number of read entries from the FIFO %d \n", fifo_entries);
        // Print the number of read data set from the FIFO
        // A data set contains acceleration measurements on all 3 axis
	pr_info("Number of read data sets from the FIFO %d \n", fifo_entries/3);
        // Print all the available data sets
	for (uint8_t idx = 0; idx < 32; idx ++) {
		if (idx < fifo_entries/3) {
			pr_info(" x=%d"".%09u m/s^2", (int)x[idx].integer, (abs)(x[idx].fractional));
			pr_info(" y=%d"".%09u m/s^2", (int)y[idx].integer, (abs)(y[idx].fractional));
			pr_info(" z=%d"".%09u m/s^2", (int)z[idx].integer, (abs)(z[idx].fractional));
			pr_info("\n");
		}
	}

	pr_info("==========================================================\n");
        // Read status register of the ADXL355 device
	ret = adxl355_get_sts_reg(adxl355, &status_flags);
	if (ret < 0)
		goto error;
        // Print status register information
	pr_info("Activity flag = %d \n", (uint8_t)(status_flags.fields.Activity));
	pr_info("DATA_RDY flag = %d \n", (uint8_t)(status_flags.fields.DATA_RDY));
	pr_info("FIFO_FULL flag = %d \n", (uint8_t)(status_flags.fields.FIFO_FULL));
	pr_info("FIFO_OVR flag = %d \n", (uint8_t)(status_flags.fields.FIFO_OVR));
	pr_info("NVM_BUSY flag = %d \n", (uint8_t)(status_flags.fields.NVM_BUSY));
	pr_info("===========================================================\n");

        // Read single temperature measurement from the ADXL355 device
	ret = adxl355_get_temp(adxl355, &temp);
	if (ret < 0)
		goto error;
        // Print single temperature measurement
	pr_info(" Temp =%d"".%09u millidegress Celsius \n", (int)temp.integer, (abs)(temp.fractional));
        
        // Wait 1 second
	no_os_mdelay(1000);
}

Project Execution

UART Output:

Single read 
 x=-1.449829705 y=2.651487605 z=9.255863675 
Number of read entries from the FIFO 15 
Number of read data sets from the FIFO 5 
 x=-1.449638480 m/s^2 y=2.651449360 m/s^2 z=9.255901920 m/s^2
 x=-1.449676725 m/s^2 y=2.651219890 m/s^2 z=9.256322615 m/s^2
 x=-1.449791460 m/s^2 y=2.650990420 m/s^2 z=9.255940165 m/s^2
 x=-1.450173910 m/s^2 y=2.651219890 m/s^2 z=9.255710695 m/s^2
 x=-1.449829705 m/s^2 y=2.651487605 m/s^2 z=9.255863675 m/s^2
==========================================================
Activity flag = 0 
DATA_RDY flag = 1 
FIFO_FULL flag = 0 
FIFO_OVR flag = 0 
NVM_BUSY flag = 0 
===========================================================
 Temp =28535.091171350 millidegress Celsius 
Single read 
 x=-1.450059175 y=2.651411115 z=9.256360860 
Number of read entries from the FIFO 12 
Number of read data sets from the FIFO 4 
 x=-1.449638480 m/s^2 y=2.651372870 m/s^2 z=9.256246125 m/s^2
 x=-1.449753215 m/s^2 y=2.651296380 m/s^2 z=9.256131390 m/s^2
 x=-1.449867950 m/s^2 y=2.651372870 m/s^2 z=9.256093145 m/s^2
 x=-1.450059175 m/s^2 y=2.651411115 m/s^2 z=9.256360860 m/s^2
==========================================================
Activity flag = 0 
DATA_RDY flag = 1 
FIFO_FULL flag = 0 
FIFO_OVR flag = 0 
NVM_BUSY flag = 0 
===========================================================
 Temp =28425.041447550 millidegress Celsius 
...

IIO Project

Makefile Selection

In order to build the IIO project make sure you have the following configuration in the Makefile:

# Select the example you want to enable by choosing y for enabling and n for disabling
DUMMY_EXAMPLE = n
IIO_EXAMPLE = y

When running make command make sure to specify the platform you want to build the project for.

Project Description

This project is actually a TINYIIOD demo for EVAL-ADXL355-PMDZ board. The project launches a TINYIIOD server on the board so that the user may connect to it via an IIO client. Using IIO-Oscilloscope, the user can configure the accelerometer and view the measured data on a plot.

If you are not familiar with ADI IIO Application, please take a look at: IIO No-OS

This IIO Project uses IIO-Oscilloscope as a client. If you are not familir with ADI IIO-Oscilloscope Client, please take a look at: IIO Oscilloscope

The No-OS IIO Application together with the No-OS IIO ADXL355 driver take care of all the backend logic needed to setup the IIO server. The user has to initialize the IIO device and call the IIO app as shown below. The read buffer is used for storing data which shall be available on the plot in the IIO Oscilloscope Client.

#define DATA_BUFFER_SIZE 400

uint8_t iio_data_buffer[DATA_BUFFER_SIZE*4*sizeof(int)];

struct iio_data_buffer accel_buff = {
	.buff = (void *)iio_data_buffer,
	.size = DATA_BUFFER_SIZE*4*sizeof(int)
};

ret = adxl355_iio_init(&adxl355_iio_desc, &adxl355_init_par);
if (ret)
	return ret;

struct iio_app_device iio_devices[] = {
	{
		.name = "adxl355",
		.dev = adxl355_iio_desc,
		.dev_descriptor = adxl355_iio_desc->iio_dev,
		.read_buff = &accel_buff,
	}
};

return iio_app_run(iio_devices, NO_OS_ARRAY_SIZE(iio_devices));

Project Execution

After flashing and running the application, IIO Oscilloscope can be used to make the desired configuration and obtain the desired data. Below you may find some snippets from IIO Oscilloscope, when running IIO Project:

Bellow you can see the Connection window for IIO Oscilloscope. The handshake is performed and the device is detected over UART. After pressing the Connect button we can see the device in the list, together with its channels and we can see the measured data.

Note that when running the project on Maxim platform, a baudrate of 57600 should be selected from the IIO Oscilloscope interface.

 IIO Oscilloscope connection to board serial

Below you can see the Simple View which contains the read data from the accelerometer. Observe how the measurements change. The accelerometer is positioned such that the gravitational force is first perpendicular on its XY plane. In this case the measured acceleration on Z axis is ~g and the measured acceleration on X and Y axis is ~ 0. The accelerometer is then positioned such that the gravitational force is perpendicular on its XZ plane. In this case the measured acceleration on Y axis is ~g, on X and Z axis is ~ 0). Finally, the accelerometer is positioned such that the gravitation force is perpendicular on its YZ plane. In this case the measured acceleration on on X axis is ~g and the measured acceleration on Y and Z axis is ~0.  IIO Oscilloscope Measurements

Below you can see the Debug View which contains the list of attributes for each channel of the selected device. Some attributes, like the calibbias, sampling frequency and the high pass filter corner frequency can be changed by the user, while the other attributes can be just read. You may also observe that some attributes of the acceleration channels are shared in value: sampling frequency, high pass filter corner frequency and scale while calibbias and raw attributes may have different value for each acceleration channel.

 Debug View

Below you can see the Plot View for the acceleration data. The Plot view shows the raw vales measured by the accelerometer. In this case the accelerometer is moved such that the gravitational force is perpendicular on XY, XZ and YZ planes. You may observe the spikes in the data due to sudden change of the accelerometer. By by applying the high pass filter, the acceleration data will be close to zero when the device is sitting still and will change when the device is moved.

Plot example.

IIO Project with Hardware Trigger

Makefile Selection

In order to build the IIO project with Hardware Trigger make sure you have the following configuration in the Makefile:

# Select the example you want to enable by choosing y for enabling and n for disabling
DUMMY_EXAMPLE = n
IIO_EXAMPLE = n
IIO_TRIGGER_EXAMPLE = y

Project Description

There is little difference between IIO Project and IIO Project with Hardware Triggers. In this case the measured data is sampled using a hardware trigger (e.g. interrupts), instead of the polling technique. ADXL355 offers the capability to use DATA_READY pin as a flag which shows when new measurements are available. Thus, DATA_READY pin is used as a hardware trigger. The code maps the DATA_READY pin as GPIO input with interrupt capabilities. When DATA_READY pin transitions from low to high, new data is available and will be read based on is_synchronous flag setting used in adxl355_iio_trigger_desc. If the flag is set to true, the data will be read immediately, in the interrupt context. If the flag is set to false, the data will be read from application context. In this case some samples might be missed.

Project Execution

After flashing and running the application, IIO Oscilloscope can be used to capture data using the configured hardware trigger. In order to select the trigger as an impulse generator, right click on the adxl355 device in the plot windows, select Impulse generator and choose adxl355-dev0 trigger, as shown below:  Plot with trigger example

resources/eval/user-guides/eval-adxl355-pmdz/no-os-setup.txt · Last modified: 27 Sep 2022 17:20 by Darius B