Wiki

The most recent version of this page is a draft.DiffThis version is outdated by a newer approved version.DiffThis version (03 Jan 2017 21:15) is a draft.
Approvals: 0/1

This is an old revision of the document!


ADXL355 Accelerometer PMOD Demo

The ADuCM360_demo_adxl355_pmdz is an accelerometer demo project for the EVAL-ADICUP360 base board with the EVAL-ADXL355-PMDZ board, using the GNU ARM Eclipse Plug-ins in Eclipse environment.

General description

This project is an example for how to use EVAL-ADICUP360 board in combination with the EVAL-ADXL355-PMDZ accelerometer PMOD board.

The ADuCM360_demo_adxl355_pmdz project uses the EVAL-ADXL355-PMDZ which has the ADXL355 3-axis MEMS accelerometer on board.

The application reads the X , Y , and Z acceleration registers. The acceleration in the 3 axis is displayed in [mG]. There is an internal temperature sensor in the ADXL355, which is read and out either in [C] or [codes], and an on board 12-bit ADC that can be used to convert an additional analog sensor input. This is set by changing the TEMP_ADC variable within the main.c file. (Value of [0] is degrees Celsius, and value [1] is ADC codes) The acceleration range can also be selected by setting the ADXL_SENSE variable with the main.c file. (Values of [2, 4, and 8 are acceptable] )

All the outputs are printed from the UART to the USER USB port and can be read on the PC using a serial terminal program, such as Putty or Tera Term.

For precision applications, each ADXL355 chip requires individual calibration which can be done by measuring and setting the definitions ACC_TEMP_BIAS and ACC_TEMP_SENSITIVITY parameters in the ADXL362.h file.

The temperature in degrees celsius, Treal , can be derived from the ADC readings Tadc using the predefined formula:

    Treal = (Tadc + ACC_TEMP_BIAS)/(1 / ACC_TEMP_SENSITIVITY)


Setting up the hardware


  • To program the base board, set the jumpers as shown in the next figure. The important jumpers are highlighted in red.

  • Plug the EVAL-ADXL355-PMDZ board in the EVAL-ADICUP360 base board, via the PMOD_SPI port (P4).
  • Power EVAL-ADICUP360 base board via the Debug USB.(If programmed, switch to the USER USB for serial terminal display)


Obtaining the source code


We recommend not opening the project directly, but rather import it into Eclipse and make a local copy in your Eclipse workspace.

To learn how to import the ADuCM360_demo_adxl355_pmdz project form the projects examples in the Git repository, please click on How to import existing projects from the GIT Repository.

The source code and include files of the ADuCM360_demo_pmodacl2 can be found on Github:


Importing the ADuCM360_demo_adxl355_pmdz project


The necessary instructions on how to import ADuCM360_demo_adxl355_pmdz project in your workspace can be found in the section, Import a project into workspace.


Debugging the ADuCM360_demo_adxl355_pmdz project


  • A debug configuration must be set up for this project in order to have the possibility to program and to debug the ADuCM360_demo_adxl355_pmdz project. To do this, follow the instructions from Setting up a Debug Configuration Page.
  • Make sure the target board is connected to the computer (via DEBUG USB) and using the tool bar, navigate to the small Debug icon and select the debugging session you created. The application will programmed and the program execution will stop at the beginning of the main() function.

  • Use step-by-step execution or directly run the program.

After completion of the steps above the program will remain written into the system flash and it will run by default every time the board is powered up.


Project structure


The ADuCM360_demo_adxl355_pmdz project use basic ARM Cortex-M C/C++ Project structure. This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripheral; port configuration for SPI0, accelerometer sensor use; SPI read/write functions; sensor monitoring.

In the src and include folders you will find the source and header files related to pmodacl2 application. You can modify as you wanted those files. The Communication.c/h files contain SPI and UART specific data, meanwhile the ADXL362.c/h files contain the accelerometer data. Here are parameters you can configure:

  • Temperature display units - TEMP_ADC parameter - 1 for ADC units or 0 for Celsius degrees (main.c ).
#define TEMP_ADC        0
  • Temperature sensor calibration values- ACC_TEMP_BIAS and ACC_TEMP_SENSITIVITY paramaters - find your values based on the calculation formula (ADXL362.h ):
#define ACC_TEMP_BIAS             (float)350
#define ACC_TEMP_SENSITIVITY      (float)0.065
  • Accelerometer range setting - ADXL_SENSE parameter - 2, 4, or 8 are acceptable values to set the [g] range for the adxl362 (main.c ).
#define ADXL_SENSE        2
  • Accelerometer scan interval - how often to update sensor information. Set the SCAN_SENSOR_TIME parameter - msec (ADXL362.h):
#define SCAN_SENSOR_TIME   500
  • Sensor activity and inactivity thresholds - ACT_VALUE and INACT_VALUE paramaters used to determine at which acceleration values the sensor can react at sleep/wake-up commands ( ADXL362.h ):
#define ACT_VALUE          50
#define INACT_VALUE        50
  • Sensor activity and inactivity time - ACT_TIMER and INACT_TIMER paramaters used to determine sleep/wake-up intervals( ADXL362.h ):
#define ACT_TIMER          50
#define INACT_TIMER        50


The system folder contains system related files (try not to change these files):

  • ADuCM360 – contains low levels drivers for ADuCM360 microcontroller.
  • CMSIS – contains files related to ADuCM360 platform, such as: ADuCM360.h (registers definitions), system_ADuCM360.c/h (system clock), vectors_ADuCM360.c (interrupt vector table).
  • cortexm – contains files for system management (start-up, reset, exception handler).


resources/eval/user-guides/eval-adicup360/reference_designs/demo_adxl355.1483474534.txt.gz · Last modified: 03 Jan 2017 21:15 by Brandon Bushey