Wiki

This version (14 Apr 2023 02:17) was approved by Marc Sosa, Jose Ramon San Buenaventura.The Previously approved version (31 Mar 2023 02:29) is available.Diff

Evaluating the LTC2672

Supported Evaluation Boards

DC2903A Overview

The DC2903A is a fully featured evaluation board that allows evaluation of the LTC2672, a five-channel, current source output digital-to-analog converter (DAC). The DC2903A is controlled through a serial peripheral interface (SPI) from the J1 connector. The SPI signals are sent from the DC2026C controller board through the ribbon cable that is connected to the DC2903A.

The LTC2672 is used for various current-mode biasing applications such as tunable lasers or resistive heaters. The output current ranges are software selectable, and each channel is routed to the DC2903A MUX pin for external monitoring.

Hardware Specifications

Power Supply Requirements

The DC2903A board has provision for dual supply operation. The positive voltage supply can range from 2.8 V to 5.5 V, while the negative supply voltage can handle voltages from -5.5 V up to 0 V or GND. To ensure proper operation, make sure that the supply used can source at least the total maximum current expected from each channel.

If the maximum current output expected from each channel is 300 mA, then the supply used should be able to source at least 1500 mA (for example, 300 mA x 5 channels) to operate the device properly across all available span and current levels.

Digital Interface (QuikEval)

The QuikEval system is a USB-based product demonstration and data acquisition system that allows users to quickly evaluate the performance of Linear Technology products, including the LTC2672. Its interface is a 14-pin connection that allows the Linduino to connect with over a hundred Analog Devices daughter boards for parts including analog-to-digital converters, digital-to-analog converters, high-voltage power monitors, temperature measurement devices, RF synthesizers, battery stack monitors, and more.

The specific interface used for the DC2903A boards is SPI.

P1 Pin Number Pin Function Mnemonic
Pin 1 +7 V. Unregulated 7V
Pin 2 I/O Voltage IOVDD
Pin 3 Board Ground GND
Pin 4 *Serial Clock SCLK
Pin 5 Master In Slave Out MISO
Pin 6 Chip Select CS
Pin 7 *Master Out Slave In MOSI
Pin 8 Board Ground GND
Pin 9 EEPROM SDA (I2C) EESDA
Pin 10 EEPROM VCC EEVCC
Pin 11 EEPROM SCL (I2C) EESCL
Pin 12 EEPROM Ground GND
Pin 13 Board Ground GND
Pin 14 Free GPIO GPIO

* - pin has alternate function. Serial Clock is for either SPI or I2C. Master Out Slave In or MOSI also acts as SDA pin for I2C mode.

ADI No-OS

The goal of ADI Microcontroller No-OS is to provide reference projects for lower end processors, which can't run Linux or aren't running a specific operating system, and 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, visit the No-OS User Guide found here.

LTC2672 Driver

Information about the LTC2672 driver can be found here: LTC2672 No-OS Driver

No-OS Supported Platforms

Maxim Platform

Hardware Setup

Required Hardware


Required Connections

The MAX32666FTHR does not have a PMOD interface, but you may use Dupont female-female cables to make the required connections. The table below shows the connection between DC2903A and MAX32666FTHR.

DC2903A Pin Number MAX32666 Pin Number Function Mnemonic
Pin 1 3V3. 3.3V Supply (for IO) 3V3
Pin 3 GND. Board Ground GND
SCK AIN3 Serial Clock SCLK
SDI AIN1 Master In Slave Out MISO
CS/LO AIN0 Chip Select CS
SDO AIN2 Master Out Slave In MOSI

After connecting the pins from the DC2903A QuikEval interface to the MAX32666FTHR's pins, connect the corresponding pins to VCC, V-, and GND. Make sure that the voltages to these pins are within the normal operating range. Power up the supplies in any order as the device doesn't need any sequencing.

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

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., 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)

Make sure the GNU Make version you are using is >= 4.2.

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 2022.2 is installed at this path:

/path/to/xilinx
├── DocNav
├── Downloads
└── Vitis
    └── 2022.2

Run:

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

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.
  • Currently we are testing projects with CubeMx Version 6.5.0, but other versions should work as well.
  • Install java (openjdk-17), sed and head (if not already present, they normally are).
  • Install python (if not already present) and make sure python command executes Python3 (not Python2). This can be easily achieved by running the following command sudo apt install python-is-python3.

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.

Mbed (Click to expand)

Mbed (Click to expand)

  • Install Mbed CLI 1 as per guide here: https://os.mbed.com/docs/mbed-os/v6.15/build-tools/install-and-set-up.html .Usually the following steps should be sufficient: sudo apt install python3 python3-pip git mercurial gcc-arm-none-eabi and sudo python3 -m pip install mbed-cli pyelftools==0.29.
  • Configure the compiler location with Mbed CLI. This can be carried out by running the “mbed config -G GCC_ARM_PATH “path-to-your-gcc-compiler”” in Command Prompt.

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)

Open up a Git Bash as Administrator once and run the tools/scripts/git-bash.sh script. Close the window. You only need to do this once per Git Bash installation.
Use Git Bash (unelevated) for the rest of your development.

Xilinx (Click to expand)

Xilinx (Click to expand)

Assuming the Vitis 2022.2 is installed at this path:

C:\Xilinx
├── DocNav
├── Downloads
└── Vitis
    └── 2022.2

Run:

$ export PATH=/c/Xilinx/Vitis/2022.2/bin:/c/Xilinx/Vitis/2022.2/gnu/aarch64/nt/aarch64-none/bin/:$PATH

Maxim (Click to expand)

Maxim (Click to expand)

  • Install the Maxim Micros SDK to a path without whitespaces like C:\MaximSDK.
  • Set the MAXIM_LIBRARIES environment variable by running: export MAXIM_LIBRARIES=/c/MaximSDK/Libraries.
  • (Optional) For visual debugging and building, install Visual Studio Code, and the Cortex-Debug extension.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

No-OS Build Project

The path of the project is no-OS/projects/max11205pmb1/

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 .xsa in the project folder.

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

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

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, max32660, max32665, max32670, max32690 and max78000.

Mbed (Click to expand)

Mbed (Click to expand)

To build a project, type:

make PLATFORM=mbed

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 PLATFORM=stm32

If during the project generation you get a dialog saying that you are using an .ioc file generated with an old CubeMX version, click Continue. Migrate is also a valid option but only if you know what you are doing.

If you're trying to use an .ioc file generated with a newer CubeMX than the one installed on your machine, you will get a prompt that asks you to upgrade your installation to the new version, there is no other choice than to click OK and then manually upgrade.

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)

Use Git Bash to run these commands.
$ 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

Xilinx (Click to expand)

Xilinx (Click to expand)

Copy the .xsa to the project folder and run:

./no-OS/projects/adrv9009
├── Makefile
├── profiles
├── src
├── src.mk
└── system_top.xsa

$ 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, max32660, max32665, max32670, max32690 and max78000.

ADuCM3029 (Click to expand)

ADuCM3029 (Click to expand)

$ export PLATFORM=aducm3029
$ make

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

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

Debug

Once the .elf, .hex or .bin 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

Xilinx (Click to expand)

Xilinx (Click to expand)

For Xilinx project you can flash the board connected to a remote host. On the remote host make sure to start `hw_server`. On your development environment run

$ export XSCT_REMOTE_HOST=<remote host ip>
$ export XSCT_REMOTE_PORT=<remote host hw_server port>
$ make run

By default the `hw_server` port should be 3121.

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.

Running/Debugging in WSL

Example Project Execution

Basic Example Project

Project Description

The basic 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 DC2903A device and change its settings, and the UART driver is used to display on the host machine the device configuration at a given instance.

The basic project contains the LTC2672 driver initialization and project functions:

/* Continuously configure the part and measure pins with multimeter for verification */
	while (1) {
		/*max current of 3.125mA*/
		ret = ltc2672_set_span_all_channels(ltc2672_desc,
						    LTC2672_50VREF);
		if (ret) {
			goto error;
		}
 
		/* Print Span set to all channels */
		pr_info("All DAC channels have span config of 3.125mA\n");
 
		for (i = 0; i < num_currents; i++) {
			ret = ltc2672_set_current_all_channels(ltc2672_desc, currents_to_set[i]);
			if (ret) {
				goto error;
			}
 
			/* Print Current set to all channels */
			pr_info("All DAC channels have current of: %0.2f mA\n", currents_to_set[i]);
 
			/*Lengthy delay to better visualize the change in values*/
			no_os_mdelay(1500);
		}
 
		/* Configure MUX pin to output the VREF measurement */
		pr_info("MUX ouptut pin configured to measure VREF (~1.25V).\n");
 
		ret = ltc2672_monitor_mux(ltc2672_desc, LTC2672_MUX_VREF);
		if (ret) {
			goto error;
		}
 
		/*Lengthy delay to better visualize the change in values*/
		no_os_mdelay(2000);
 
		/* Chip Power Down */
		pr_info("Chip Power Down. All Channels and VREF should measure 0.\n");
 
		ret = ltc2672_chip_power_down(ltc2672_desc);
		if (ret) {
			goto error;
		}
 
		/*Lengthy delay to better visualize the change in values*/
		no_os_mdelay(2000);
 
		/* Setup and Demo toggle function on OUT3 */
		pr_info("Toggle function on OUT3. Current toggles between %0.2f and %0.2f mA.\n",
			currents_to_toggle[0], currents_to_toggle[1]);
 
		ret = ltc2672_setup_toggle_channel(ltc2672_desc, LTC2672_DAC3,
						   currents_to_toggle[0], currents_to_toggle[1]);
		if (ret) {
			goto error;
		}
 
		ret = ltc2672_enable_toggle_channel(ltc2672_desc, 8);
		if (ret) {
			goto error;
		}
 
		for (i = 0; i < toggle_times; i++) {
			toggle_flag ^= true;
 
			ret = ltc2672_global_toggle(ltc2672_desc, toggle_flag);
			if (ret) {
				goto error;
			}
 
			/*Lengthy delay to better visualize the change in values*/
			no_os_mdelay(2000);
		}
 
		ret = ltc2672_enable_toggle_channel(ltc2672_desc, 0);
		if (ret) {
			goto error;
		}
 
		/*Lengthy delay to better visualize the change in values*/
		no_os_mdelay(2000);
 
	}// end while

Project Execution

Serial output when running the basic project:

All DAC channels have span config of 3.125 mA
All DAC channels have current of: 0.21 mA
All DAC channels have current of: 0.41 mA
All DAC channels have current of: 1.21 mA
All DAC channels have current of: 1.41 mA
MUX ouptut pin configured to measure VREF (~1.25V).
Chip Power Down. All Channels and VREF should measure 0.
Toggle function on OUT3. Current toggles between 0.40 and 0.10 mA.



Hardware Output Checking

Here are the steps on checking the hardware output when using the example code.

  1. Connect the DC2903A to the MAX32666FTHR microcontroller board by following the required connections in Hardware Setup.
  2. Build and load the example .hex file to the microcontroller board.
  3. Reset or reconnect the microcontroller board to the computer or a power supply.
  4. Using a DC ammeter, check all channels (OUT0~OUT3) for current readings.
  5. Using a DC voltmeter, measure the voltage on MUX pin; it should read ~1.25 V.
  6. Using a DC ammeter, measure the changes in current on OUT3; it should sequentially read ~0.21 A, ~0.41 A, ~1.21 A, ~1.41 A.
  7. A power down command should come after the above sequence. During this state, OUT3 should read ~0 A.
  8. A toggle command will execute after powering down. During this state, OUT3 should sequentially read ~0.4 A, ~0.1 A.
  9. Repeat the processes above to confirm functionality.
The example project runs sequentially and continuously repeats the process until power is removed.




End of document

resources/eval/user-guides/dc2903a/no-os-setup.txt · Last modified: 14 Apr 2023 02:16 by Marc Sosa