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 [19 Apr 2021 14:01] – [Software Downloads] 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>resources/ |
- | ===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 the code, see below for more detail: | + | |
- | - Connect the AD4130 EVAL-board to the SDP-K1 controller board as specified in hardware connections section. | + | |
- | - 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 ' | + | |
- | - Ensure SDP-K1 controller board is selected (top right of online-compiler page). (SDP-K1 platform pre-installed from [[https:// | + | |
- | - The original firmware program may require few configurations to suits the REV E board. | + | |
- | - Open the **app** folder and open the file **app_config.h**. | + | |
- | - Comment line 31 and uncomment line 32 to select WLCSP package type for AD4130. | + | |
- | - Go to line 49 and line 54, change source pin **D3** to **D2**. | + | |
- | - Go to line 51 to change SDP-120 source pin from **SDP_GPIO_1** to **SDP_GPIN_5**.\\ {{ : | + | |
- | - Compile the code. | + | |
- | - After a successful compile a binary will be downloaded to your computer - store this on your drive. | + | |
- | - Drag and drop this binary to the USB drive hosted by your controller board. | + | |
- | *Note: For more details on importing code into Mbed online compiler, refer below link (Section: Importing | + | |
- | from local machine): [[https:// | + | |
- | ===Libiio: IIO Library=== | + | |
- | This library provides an abstracted library interface to communicate IIO device (AD4130) and IIO client application (IIO Oscilloscope) without worrying about the low level hardware details. Download and install below [[resources: | + | |
- | Libiio installer for Windows (Use below link): | + | |
- | * [[https:// | + | |
- | ===IIO Oscilloscope (Client)=== | + | |
- | This is a GUI (Graphical User Interface) based IIO client application for data visualization and device configuration/ | + | |
- | IIO Oscilloscope installer for Windows (Use below link): | + | |
- | * [[https:// | + | |
- | ===Evaluating AD4130 Using IIO Ecosystem=== | + | |
- | Ensure that hardware connection has been made properly in between Controller Board (SDP-K1) and AD4130 Eval board. Also ensure all software' | + | |
- | ===Running IIO Oscilloscope (Client)=== | + | |
- | Open the IIO Oscilloscope application from start menu and configure the serial (UART) settings as shown below. | + | |
- | Click on refresh button and AD4130 device should pop-up in IIO devices list. | + | |
- | {{ : | + | |
- | Click ' | + | ---- |
- | below screen after selecting available | + | |
+ | ===== Software Downloads ===== | ||
+ | |||
+ | {{section> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Evaluating AD4130 Using IIO Ecosystem ==== | ||
+ | |||
+ | {{section> | ||
+ | |||
+ | ==== Running IIO Oscilloscope (Client) ==== | ||
+ | Open the IIO Oscilloscope application from start menu and configure the serial (UART) settings as shown below. Click on refresh button and AD4130 device should pop-up in IIO devices list. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Click ' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | ==== Configure/ | ||
+ | |||
+ | The IIO Oscilloscope allows user to access and configure different device parameters, called as 'Device Attributes“. There are 2 types of attributes: | ||
+ | - Device Attributes (Global): Access/ | ||
+ | - Channel Attributes (Specific to channels): Access/ | ||
- | ===Configure/ | ||
- | The IIO Oscilloscope allows user to access and configure different device parameters, called as ' | ||
- | There are 2 types of attributes: | ||
- | - Device Attributes (Global): Access/ | ||
- | - Channel Attributes (Specific to channels): Access/ | ||
How to read and write attribute: | How to read and write attribute: | ||
* To ' | * To ' | ||
- | * 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 # | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ==== Data Capture from IIO Device ==== | ||
+ | |||
+ | To capture the data from AD4130 IIO device, simply select the device and channels to read/ | ||
+ | |||
+ | <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 to configured INT source is triggered and conversion result is read into a internal acquisition buffer. | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | === Time Domain Plot === | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Frequency Domain Plot === | ||
+ | <fc # | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== 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 in the firmware. | ||
+ | |||
+ | - User Default Config (All channels test) | ||
+ | - 2-wire/ | ||
+ | - 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/ | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | === Demo Mode Selection === | ||
+ | The sensor mode selection is done from “app_config.h” file using “ACTIVE_DEMO_MODE_CONFIG” macro. The selection is done at compilation time, that means only one sensor demo mode is active at a time. Whenever demo mode is changed from app_config.h file, the code must be compiled again to generate a new binary file for that. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === 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 can be executed from ‘Visual Studio Code’ or any other preferred IDE/console prompt application using “python script_name.py” command as shown below. The demo config is fetched from the firmware by establishing serial (UART/VCOM) connection between host and MCU (sdp-k1). Refer next section | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Sensor Channels Calibration === | ||
+ | It is possible to calibrate the device channels which are connected to external sensors. The sensors calibration (gain and offset) is done by executing the python script | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== AD4130 Firmware Structure ==== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === 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 data capture mode (Continuous, | ||
+ | - 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/ | ||
+ | |||
+ | === 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/ | ||
+ | |||
+ | === 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 |