ADMW1001 Programmer's Guide.
Firmware development with Arm® MBED .
The ADMW1001 Pro Development Kit features an Arduino formfactor header which enables easy interfacing with various microcontroller development kits.
ADI MeasureWare provides an Embedded API compatible with the ADMW1001 Pro Development Kit, which aids embedded software development should you wish to develop custom firmware. This API exposes functions for configuring the ADMW1001 and reading back measurement results.
NOTE: The MeasureWare API and example project is currently in Beta. Only the STNucleo-411RE development kit has been fully tested with the API and example project.
The MeasureWare ADMW1001 Embedded API is provided on the Arm Mbed platform. Mbed provides a hardware abstracted API enabling the use of over 150 different Arm based embedded development platforms. Using the Mbed online IDE (https://ide.mbed.com) you can compile and run the MeasureWare example firmware on your target platform in just a couple of minutes, with no IDE installation required.
The Online IDE provides basic code editing and compilation. More advanced editing and debugging capabilities may require the use of an installed embedded IDE such as IAR or KEIL. More information on exporting your Mbed project to these IDE’s is provided at the end of this guide.
The ADMW1001 API and the accompanying example firmware project is available at the following link: https://os.mbed.com/teams/AnalogDevices/code/EV-PRO-MW1001/
The Pro Development Kit features logic level shifters and can be used with 3.3V or 5V logic level systems. Ensure that the “Board Select” switch on the Pro Development Kit is set to position “A” for correct operation.
The digital pins used on the Pro Development Kit Arduino header are as follows. Refer to the ADMW1001 data sheet for more information on digital pin functions.
D0, D1, D2
DRDY (Data Ready)
CS (CHIP SELECT)
SDA - EEPROM
SCL - EEPROM
The following steps will generate firmware for the STM32F411 which returns 10 temperature measurement results over the PC UART interface. (Note. A K-Type Thermocouple sensor board is required in order to get valid sensor measurements with the default configuration)
1. Open the EV-PRO-MW1001 project landing page: https://os.mbed.com/teams/AnalogDevices/code/EV-PRO-MW1001/.
2. Click the “Import into Compiler” link at the top right hand corner of the landing page.
3. You may be prompted to sign in to the Mbed IDE. If you do not already have an account register a new account with Mbed.
4. The Mbed IDE will open in a new tab in your browser. An “Import Program” dialog will appear on screen. Give your program a name and click import to add it to the workspace.
5. Ensure that the NUCLEO-F411RE board is selected as the target in your IDE. This should appear in the top right hand corner of the IDE.
If this does not display “NUCLEO-F411RE”, click on the button and add the “Nucleo-F411RE” by selecting the “Add Board” icon that appears in the “Select a Platform” dialog. This will open a platform search page in a new tab. Find the NUCLEO-F411RE” board and select the option to “Add to your Mbed Compiler”.
6.Select the “main.cpp” file in the project. This should open up in a tab in the Mbed IDE.
This contains the example program demonstrating how to Reset, Configure, and read ADMW1001 measurement results and device status.
7.Click “Compile” on the Mbed menu bar to compile and download the embedded firmware image. This will appear as a .bin file in your download folder.
8. Copy this .bin file to the “NODE_F411RE” drive that appears on your PC when the NUCLEO_F411 is connected via USB.
9. To view measurement data returned from the ADMW1001 , open a serial terminal (such as Putty or Realterm) and connect to the “STMicroelectronics” COM port using a baud of 115200.
The image below shows the example firmware serial printout (using Putty) when the firmware has been configured for a K-Type thermocouple with a PT100 RTD used for cold junction compensation.
The first number of lines in the UART printout will display the program execution status and any errors encountered in communicating with or configuring the ADMW1001. After these info messages the printout will display measurement readings for each of the sensors. These measurement readings are printed one after another, line by line, using the following format:
The ADMW1001 configuration is set in the EV-PRO-MW1001 Mbed project by including a “config.c” file that specifies the configuration using an “ADMW_CONFIG” struct. In main.cpp an extern is declared with the type “ADMW_CONFIG” referencing this struct. A pointer to this external variable is passed to the admw_SetConfig API.
The EV-PRO-MW1001 Mbed project includes 9 example configuration C files demonstrating different sensor combinations and sequencer configurations. Each of these configuration files are referenced by an extern variable at the top of main.cpp. One of these configurations can be selected by changing the pSelectedConfig pointer in main.cpp to reference a specific configuration. Be sure to include a “&” when specifying the selected config as the configuration must be passed by pointer rather than by value.
A configuration file specific to your measurement system design is available to download from MeasureWare designer. Using this configuration with the Mbed project is a simple process.
1. Open MeasureWare designer and download the configuration zip archive for your chosen design.
2. Extract the files from the zip archive and locate the [DesignName]c file.
3. Open the Mbed IDE. Drag and drop this C file into the EV-PRO-MW1001 project in your program workspace.
4. Add extern ADMW_CONFIG default_config; in main.cpp file
5. Open main.cpp and change the pSelectedConfig as follows:
Note: More detailed descriptions of all configuration file parameters can be found in the ADMW1001 API documentation file which is available from the MeasureWare Engineer Zone page.
Configuration C files used with the ADMW1001 API contain a single ADMW_CONFIG struct. It is a pointer to this struct which is passed to the admw_setConfig API. All configurable ADMW1001 parameters can be customized by changing settings in this struct.
The ADWM_CONFIG struct has the following schema:
Which should be “ADMW_PRODUCT_ID_ADMW1001”
Most configuration file properties are defined using enums. The range of allowable values can be found by viewing the enum definition in admw1001_conig.h. In the Mbed IDE you can quickly see other valid values for an enum by holding down the ctrl key and clicking an existing value in the configuration file. Click the “A” button that appears in the pop up dialog, this will jump to the relevant section in the admw1001_config.h file.
If you require more advanced debugging (breakpoints, code stepping etc.) or advanced code editing/compilation it may be necessary to use a more advanced embedded IDE such as KEIL or IAR. Mbed provides a simple export wizard to export a program from the Mbed IDE to several 3rd IDEs.
To export a program, right click on the program folder in the “Program Workspace” and select the “Export Program” option.
This will launch a pop up dialog where the target hardware platform and target toolchain can be selected. Clicking export will download a zip file with the exported project.