This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:eval:user-guides:ad4130:mbed_iio_app [16 Apr 2021 11:40] – Zhaoqun Guo | resources:eval:user-guides:ad4130:mbed_iio_app [31 May 2023 07:54] (current) – Mahesh Phalke | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Mbed IIO Application===== | + | ===== AD4130 |
- | ====Introduction==== | + | |
- | This page gives an overview of using the ARM Mbed platform | + | ===== Introduction |
+ | |||
+ | This page gives an overview of using the ARM platforms | ||
Devices AD4130 Evaluation board and SDP-K1 controller board. This example code leverages | Devices AD4130 Evaluation board and SDP-K1 controller board. This example code leverages | ||
the ADI developed IIO (Industrial Input Output) ecosystem to evaluate the AD4130 device by providing a | the ADI developed IIO (Industrial Input Output) ecosystem to evaluate the AD4130 device by providing a | ||
device debug and data capture support. | device debug and data capture support. | ||
- | The overview of an entire system is shown below: | + | |
- | {{ :resources:eval:user-guides: | + | {{section>resources/tools-software/ |
- | IIO oscilloscope is used as client application running on windows-os, which is ADI developed GUI for | + | |
- | ADC data visualization and device debug. The interface used for communicating client application with | + | ---- |
- | firmware application (IIO device) is UART. The firmware application communicates with IIO device | + | |
- | (AD4130) using ADI No-OS drivers and platform drivers low level software layers. SDP-K1 is used as | + | |
- | controller board, on which IIO firmware application runs and using above software libraries, the IIO | + | |
- | firmware communicates with AD4130 IIO device. The AD4130 eval board is used for development and | + | |
- | testing of this application. | + | |
===Useful links=== | ===Useful links=== | ||
- | | + | {{section> |
- | * [[https://os.mbed.com/ | + | |
+ | * [[adi>en/products/ad4130-8.html# | ||
+ | |||
+ | ---- | ||
====Hardware Connections==== | ====Hardware Connections==== | ||
+ | {{ : | ||
+ | |||
===Jumper Settings=== | ===Jumper Settings=== | ||
* SDP-K1:\\ Connect the VIO_ADJUST jumper on the SDP-K1 board to 3.3V position to drive SDP-K1 GPIOs at 3.3V | * SDP-K1:\\ Connect the VIO_ADJUST jumper on the SDP-K1 board to 3.3V position to drive SDP-K1 GPIOs at 3.3V | ||
- | * EVAL-AD4130: | + | * EVAL-AD4130: |
+ | |||
+ | < | ||
- | ===Hardware Interface=== | ||
- | {{ : | ||
AD4130 uses SPI communication for device register access and data capture. | AD4130 uses SPI communication for device register access and data capture. | ||
- | SDP-K1 is powered through USB connection from the computer. SDP-K1 acts as a Serial device when connected to PC, which creates a COM Port to connect to IIO Oscilloscope GUI running on windows-os. The COM port assigned to a device can be seen through the device manager for windows based OS. | ||
- | {{ : | ||
- | ====Software Downloads==== | + | {{section> |
- | ===Firmware=== | + | |
- | ==Quick Start to Use Mbed IIO Firmware== | + | ---- |
- | If you have some familiarity with the Mbed platform, the following is a basic list of steps required to start running | + | |
- | - Connect the AD4130 EVAL-board | + | ===== Software Downloads |
- | - Connect the SDP-K1 controller board to your computer over USB provided along with SDP-K1 board. | + | |
- | - Go to the link of the code provided above in the 'Downloads' | + | {{section> |
- | - Ensure SDP-K1 controller board is selected (top right of online-compiler page). (SDP-K1 platform pre-installed | + | |
- | - Compile | + | ---- |
- | - After a successful compile a binary will be downloaded | + | |
- | - Drag and drop this binary | + | ==== Evaluating AD4130 Using IIO Ecosystem ==== |
- | *Note: | + | |
- | from local machine): [[https://os.mbed.com/handbook/Importing-code|here]]. | + | {{section> |
- | ===Libiio: IIO Library=== | + | |
- | This library provides an abstracted library interface to communicate IIO device | + | ==== Running |
- | Libiio installer for Windows | + | Open the IIO Oscilloscope application from start menu and configure |
- | | + | |
- | ===IIO Oscilloscope (Client)=== | + | {{ : |
- | This is a GUI (Graphical | + | |
- | IIO Oscilloscope installer for Windows | + | Click 'Connect' and it should by default open the data ‘Capture’ window. You can drag aside or close this window |
- | | + | |
+ | {{ : | ||
+ | |||
+ | |||
+ | ==== Configure/ | ||
+ | |||
+ | The IIO Oscilloscope allows user to access and configure different device parameters, called | ||
+ | - Device Attributes (Global): Access/ | ||
+ | - Channel Attributes (Specific | ||
+ | |||
+ | How to read and write attribute: | ||
+ | * To ' | ||
+ | * To ' | ||
+ | |||
+ | ==== Using DMM Tab to Read DC Voltage on Input Channels ==== | ||
+ | |||
+ | DMM tab can be used read the instantaneous voltage applied on analog input channels. Simply select the device and channels to read and press start button. | ||
+ | |||
+ | <fc #ff0000>//*Note: The voltage is just instantaneous, | ||
+ | |||
+ | {{ :resources:tools-software:product-support-software: | ||
+ | |||
+ | ==== Data Capture from IIO Device ==== | ||
+ | |||
+ | To capture the data from AD4130 IIO device, simply select the device and channels to read/ | ||
+ | |||
+ | <fc #ff0000>//*Note: The DMM or Debug tab should not be accessed when capturing data as this would impact data capturing. Both DMM scan and data capture uses different methods of conversion. The DMM data is read using single conversion, while data capture uses continuous conversion mode of operation.//</fc> | ||
+ | |||
+ | More info here: [[resources: | ||
+ | |||
+ | Data capturing utilizes two modes: | ||
+ | - Normal sequencer: In this mode, the channel for which data to be captured are enabled and automatically added into a sequencer. The sequencer operates in the continuous conversion mode. After each conversion, an interrupt signal attached | ||
+ | |||
+ | - FIFO mode: This mode uses the internal FIFO of device to store the ADC samples. The conversion happens in continuous conversion mode and an interrupt signal attached | ||
+ | |||
+ | |||
+ | === Time Domain Plot === | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | {{ :resources:eval: | ||
+ | |||
+ | === Frequency Domain Plot === | ||
+ | <fc #ff0000>//*Note: Max 4096 samples can be selected for plotting frequency domain response due to limited buffer size in the firmware.//</ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Python Environment and Scripts ==== | ||
+ | |||
+ | Data capture, sensor measurement, | ||
+ | |||
+ | {{section> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Sensor Demo Modes ==== | ||
+ | AD4130 IIO firmware provides support for interfacing different sensors to analog inputs and perform the measurement on them. Below sensor demo modes are supported | ||
+ | |||
+ | - User Default Config | ||
+ | | ||
+ | - Thermistor (Default is 10K NTC) | ||
+ | - Thermocouple (Default is T type TC and PT1000 RTD as CJC) | ||
+ | - Load Cell (4-wire bridge) | ||
+ | - Noise Test (AIN0-AIN1 shorted) | ||
+ | - ECG | ||
+ | - Power Test (ADC internal channels voltage/current measurement) | ||
+ | |||
+ | <fc #ff0000>//*Note: The selection of default sensor types can be changed from ‘ad4130_temperature_sensor.cpp’ file to large extent and from respective user config header files to some extent.//</ | ||
+ | |||
+ | === Demo Mode Selection | ||
+ | The sensor mode selection | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Demo Mode User Configuration === | ||
+ | |||
+ | Firmware maintains the unique user configuration file for each sensor demo mode as per below table. The configurations can be updated by using .c and .h user config files. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Sensor Measurement === | ||
+ | Sensor measurement for RTD, Thermistor, Thermocouple, | ||
+ | |||
+ | Sensor measurement for Load Cell can be done by executing the python script available in the project “scripts” folder. IIO oscilloscope can only support measurement for voltage, current and temperature quantities and threfore python code is developed to support measurement for other sensor types. | ||
+ | |||
+ | The python script can be executed | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Sensor Channels Calibration === | ||
+ | It is possible | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== AD4130 Firmware Structure ==== | ||
+ | |||
+ | {{ :resources:eval:user-guides:ad4130: | ||
+ | |||
+ | === app_config.h === | ||
+ | - Select the AD4130 device package (either LFCSP or WLCSP). Default is WLCSP. The corresponding hardware board must be used with software selected package type. | ||
+ | - Select demo config mode (e.g. Thermistor, 2-wire RTD, etc). | ||
+ | | ||
+ | - Select UART/VCOM (only for SDP-K1). | ||
+ | |||
+ | === ad4130_user_config.c === | ||
+ | This file defines the user configurations for the AD4130, such as SPI parameters (frequency, mode, etc) and other init parameters used by No-OS drivers to initialize AD4130 device (e.g. required GPIOs, software/hardware mode, etc). These are the parameters loaded into device when device is powered-up or power-cycled. | ||
+ | |||
+ | === ad4130_data_capture.c === | ||
+ | This file implements the data capturing logic for the AD4130 device. The data capturing can be done using normal ‘Sequencer’ Or using internal ‘FIFO’. Enable the macro ‘FIFO_ENABLED’ for enabling FIFO mode. | ||
+ | |||
+ | === ad4130_iio.c === | ||
+ | This file defines getter/setter functions for all the device and channel specific attributes | ||
+ | |||
+ | === No-OS Drivers for AD4130 === | ||
+ | The no-os drivers provide the high level abstracted layer for digital interface of AD4130 devices. The complete digital interface (to access memory map and perform data read) is done in integration with platform drivers. | ||
+ | The functionality related with no-os drivers is covered in below 2 files: | ||
+ | - ad413x.c | ||
+ | - ad413x.h | ||