Example program for EVAL-ADMX2001

Dependencies:   ADMX2001

Committer:
nsheth
Date:
Wed Nov 17 18:15:37 2021 +0000
Revision:
15:fca7551aaf0a
Parent:
11:9d9cca17d2b1
Updating default .lib file for eval platform

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kjansen45 0:a74ad5b8dc7b 1 Evaluation Boards/Products Supported
Kjansen45 0:a74ad5b8dc7b 2 ------------------------------------
nsheth 9:29db35656fcb 3 EVAL-ADMX2001
Kjansen45 0:a74ad5b8dc7b 4
Kjansen45 0:a74ad5b8dc7b 5 Overview
Kjansen45 0:a74ad5b8dc7b 6 --------
Kjansen45 0:a74ad5b8dc7b 7 These code files provide the console application and device libraries to
nsheth 9:29db35656fcb 8 interface with ADMX2001 board. This code was developed and tested on SDP-K1
Kjansen45 0:a74ad5b8dc7b 9 controller board: https://os.mbed.com/platforms/SDP_K1/
Kjansen45 0:a74ad5b8dc7b 10
nsheth 9:29db35656fcb 11 Product details:
nsheth 9:29db35656fcb 12 Eval board details:
nsheth 9:29db35656fcb 13 User Guide for this code:
Kjansen45 0:a74ad5b8dc7b 14 Communication Protocol: SPI
Kjansen45 0:a74ad5b8dc7b 15
Kjansen45 0:a74ad5b8dc7b 16
Kjansen45 0:a74ad5b8dc7b 17 Hardware Setup
Kjansen45 0:a74ad5b8dc7b 18 --------------
nsheth 9:29db35656fcb 19 Required: SDP-K1 (or alternative MBED enabled controller board), ADMX2001,
Kjansen45 0:a74ad5b8dc7b 20 USB cable.
nsheth 9:29db35656fcb 21 Plug in the ADMX2001 board on SDP-K1 board (or any other Mbed enabled
Kjansen45 0:a74ad5b8dc7b 22 controller board) using the SDP connector and screws.
Kjansen45 0:a74ad5b8dc7b 23 Connect SDP-K1 board to the PC using the USB cable.
Kjansen45 0:a74ad5b8dc7b 24
Kjansen45 0:a74ad5b8dc7b 25
Kjansen45 0:a74ad5b8dc7b 26 How to Get Started
Kjansen45 0:a74ad5b8dc7b 27 ------------------
Kjansen45 0:a74ad5b8dc7b 28 Open Mbed online compiler. https://ide.mbed.com/compiler
nsheth 9:29db35656fcb 29 Import Code into compiler from here: https://os.mbed.com/teams/AnalogDevices/code/EVAL-ADMX2001/
nsheth 11:9d9cca17d2b1 30 instructions on how to import code are here: https://os.mbed.com/docs/mbed-os/v6.15/build-tools/importing-code.html
nsheth 9:29db35656fcb 31 Compile code. Open Tera Term (or alternative), select serial communication with 115200 baud rate, and the applicable COM
nsheth 9:29db35656fcb 32 port. Drag and drop binary into SDP-K1 controller board. Find detailed
nsheth 11:9d9cca17d2b1 33 instructions here: https://os.mbed.com/docs/mbed-os/v6.15/build-tools/getting-your-program-on-your-board.html
nsheth 9:29db35656fcb 34 Tera term will then display the print output of your complied code.
Kjansen45 0:a74ad5b8dc7b 35
nsheth 9:29db35656fcb 36 Details of Operation
nsheth 9:29db35656fcb 37 --------------------
nsheth 9:29db35656fcb 38
nsheth 9:29db35656fcb 39 The ADMX2001 library, contain the code required to interface with the ADMX2001 module via the SPI interface.
nsheth 9:29db35656fcb 40 The EVAL-ADMX2001 is a program that initialises the spi interface and uses the ADMX2001 library to communicate with the
nsheth 9:29db35656fcb 41 ADMX2001 module.
nsheth 9:29db35656fcb 42 This code performs a measurement and calibration. The set of SPI read/write operations needed for measurement and
nsheth 9:29db35656fcb 43 calibration are present in measure.cpp and calibrate.cpp respectively.
nsheth 9:29db35656fcb 44 The gpio_config file contains code to interface with the on board resistors and allow us to change the test load across the ADMX2001 terminals.
Kjansen45 0:a74ad5b8dc7b 45
nsheth 10:186e097fb1e3 46 Before any operation, the board is reset to default attribute values by performing a software reset of the module.
nsheth 10:186e097fb1e3 47 This is achieved by sending command with command ID 0x12 (CMD_RESET).
nsheth 10:186e097fb1e3 48
nsheth 10:186e097fb1e3 49 The steps followed for measurement are as follows :-
nsheth 10:186e097fb1e3 50
nsheth 10:186e097fb1e3 51 1. Set the test load across the ADMX2001 terminal to a 1000 ohm resistor, by setting mux enable select to 3.
nsheth 10:186e097fb1e3 52 2. Send SPI command with commmand ID as 0x0F (CMD_Z) to initiate a measurement.
nsheth 10:186e097fb1e3 53 3. Poll the status and wait for bit 32 (ADMX200X_STATUS_MEASURE_DONE_BITM) of the status to be set.
nsheth 10:186e097fb1e3 54 4. Once the ADMX200X_STATUS_MEASURE_DONE_BITM bit is set, the measurment fifo will be populated with the measured values.
nsheth 10:186e097fb1e3 55 Read these values by reading the complete fifo.
nsheth 10:186e097fb1e3 56 5. To acquire the sweep points, firstly send SPI command with command ID 0x11 (CMD_READ_SWEEP_POINTS).
nsheth 10:186e097fb1e3 57 Then read the complete fifo now populated with the sweep points.
nsheth 10:186e097fb1e3 58 6. Format and display the sweep points along with the corresponding measured values.
nsheth 10:186e097fb1e3 59 7. In case of any error in this process, clear the SPI and abort the measurement by sending SPI command with command ID 0x1A (CMD_ABORT).
nsheth 10:186e097fb1e3 60
nsheth 10:186e097fb1e3 61 The steps followed for calibration are as follows :-
nsheth 10:186e097fb1e3 62
nsheth 10:186e097fb1e3 63 1. Set the test load across the ADMX2001 terminal to a 0 ohms (short), by setting mux enable select to 1.
nsheth 10:186e097fb1e3 64 2. Set the voltage gain to 0 by sending a SPI command with 0 as the data and with command ID as 0x28 (CMD_VOLTAGE_GAIN).
nsheth 10:186e097fb1e3 65 3. Set the current gain to 0 by sending a SPI command with 0 as the data and with command ID as 0x29 (CMD_CURRENT_GAIN).
nsheth 10:186e097fb1e3 66 4. To perform either short, open or load calibration, send SPI command with command ID as 0x04 (CMD_CALIBRATE).
nsheth 10:186e097fb1e3 67 The address and the data for this command needs to be set according to the type of calibration.
nsheth 10:186e097fb1e3 68 For example, sending address as 1 performs short calibration.
nsheth 10:186e097fb1e3 69 5. Poll the status and wait for bit 32 (ADMX200X_STATUS_MEASURE_DONE_BITM) of the status to be set.
nsheth 10:186e097fb1e3 70 6. The fifo will now contain the measurement performed during calibration, the measurement values and the sweep points can be read similar to how its done during a simple measurement.
nsheth 10:186e097fb1e3 71 7. Print the measurement in the appropriate format, in case of failure, read warning register, and status register to pinpoint the exact error.
nsheth 10:186e097fb1e3 72
Kjansen45 0:a74ad5b8dc7b 73 Notes
Kjansen45 0:a74ad5b8dc7b 74 -----
Kjansen45 0:a74ad5b8dc7b 75 If using Win 7, install serial drivers for Mbed. https://os.mbed.com/docs/mbed-os/v5.12/tutorials/windows-serial-driver.html
Kjansen45 0:a74ad5b8dc7b 76 A detailed user guide on SDP-K1 controller board is available here https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/SDP-K1.html.
Kjansen45 0:a74ad5b8dc7b 77
Kjansen45 0:a74ad5b8dc7b 78
Kjansen45 0:a74ad5b8dc7b 79 License
Kjansen45 0:a74ad5b8dc7b 80 -------
nsheth 9:29db35656fcb 81 Copyright (c) 2021 Analog Devices, Inc. All rights reserved.
Kjansen45 0:a74ad5b8dc7b 82
Kjansen45 0:a74ad5b8dc7b 83 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Kjansen45 0:a74ad5b8dc7b 84 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Kjansen45 0:a74ad5b8dc7b 85 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Kjansen45 0:a74ad5b8dc7b 86 - Modified versions of the software must be conspicuously marked as such.
Kjansen45 0:a74ad5b8dc7b 87 - This software is licensed solely and exclusively for use with processors/products manufactured by or for Analog Devices, Inc.
Kjansen45 0:a74ad5b8dc7b 88 - This software may not be combined or merged with other code in any manner that would cause the software to become subject to terms and conditions which differ from those listed here.
Kjansen45 0:a74ad5b8dc7b 89 - Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Kjansen45 0:a74ad5b8dc7b 90 - The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
Kjansen45 0:a74ad5b8dc7b 91
Kjansen45 0:a74ad5b8dc7b 92 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kjansen45 0:a74ad5b8dc7b 93
nsheth 9:29db35656fcb 94 2021-01-10-7CBSD SLA