Wiki

This version (08 May 2019 22:58) was approved by Brandon.The Previously approved version (29 Aug 2017 21:43) is available.Diff

ADT7420 Temperature Sensor Demo [with EVAL-ADT7420-PMDZ]

The ADICUP3029_ADT7420 is a temperature sensor demo project for the EVAL-ADICUP3029 base board with additional EVAL-ADT7420-PMDZ shield, created using the Analog Devices Cross Core Embedded Studio.

General Description/Overview

The ADICUP3029_ADT7420 project uses EVAL-ADT7420-PMDZ PMOD which is a 16-bit ambient temperature sensor. It requires no calibration.

Demo Video

The Adobe Flash Plugin is needed to display this content.

Demo Requirements

The following is a list of items needed in order to replicate this demo.

  • Hardware
    • EVAL-ADICUP3029
    • EVAL-ADT7420-PMDZ
    • Mirco USB to USB cable
    • PC or Laptop with a USB port
  • Software
    • ADICUP3029_ADT7420 software
      • Inside Sensor_Sw Pack (1.0.0 or higher)
    • CrossCore Embedded Studio (2.6.0 or higher)
    • ADuCM302x DFP (2.0.0 or higher)
    • ADICUP3029 BSP (1.0.0 or higher)
    • Android IoTNode App (optional - For Bluetooth transmission only)
    • Serial Terminal Program (Required for running in release mode only)
      • Such as Putty or Tera Term

Setting up the Hardware

  1. Plug the EVAL-ADT7420-PMDZ PMOD into the EVAL-ADICUP3029 board's I2C PMOD connector(P9).
  2. Place the (S5) switch position to read “Wall/USB”, and the (S2) switch position to read “USB”.
  3. Plug in the micro USB cable into the (P10) USB port on the EVAL-ADICUP3029, and the other end into the PC or laptop.

Configuring the Software

In the adt7420_app.h header files you can configure the following parameters:

  • ADI_APP_DISPATCH_TIMEOUT - DISPATCH TIMEOUT will define how often the data is sent over Bluetooth.
  • ADI_APP_USE_BLUETOOTH - ENABLE BLUETOOTH parameter - will either use Bluetooth or will have the option to print to console window in debug mode or terminal in release mode.

Outputting Data

Once the hardware is setup and software is configured, user needs to select how they want to view the data coming from the temperature sensor(ADT7420).

There are three different ways to visualize the data:

  • CrossCore Embedded Studio Console Window (through semihosting)
  • Serial Terminal Program (such as Putty or Tera Term)
  • IoTNode Smart Device App

Depending on how you want to operate the board and visualize the data, there are two different options that must be selected from. Below is a table outlining the general operation, and you need to click on which launch file you need to program onto the EVAL-ADICUP3029, and hit the <F5> key on your keyboard.

Data Output Destination Connected to Debugger Configuration File
CCES Console Window Yes ADICUP3029_Debug.launch
PC/Laptop Serial Terminal No ADICUP3029_Release.launch
IoTNode Smart App Yes ADICUP3029_Debug.launch
IoTNode Smart App No ADICUP3029_Release.launch




Debug Launch Mode

Debug launch mode is used when connected to the debugger. In debug mode, all the outputs are directed to the console window of the CrossCore tools via semihosting. The data is also sent by default to the IoTNode smart app (ADI_APP_USE_BLUETOOTH =1), but can be turned of if desired by setting ADI_APP_USE_BLUETOOTH = 0.

Figure shows when ADI_APP_USE_BLUETOOTH is set to 1, sensor data is sent to android application.

If you have the app installed on your phone, these figure shows the output on android device.

Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.

  1. Simply open up the IoTNode application on your phone.
  2. “Scan” for nearby demos.
  3. Once you find your demo, click on it to open it up.



It's important to remember that when you use the Debug.launch file that you hit the “play” button when using the tools or else your program will not run.

Release Launch Mode

Release launch mode is used for running without the debugger connected. When in release mode, console output is redirected to UART. Bluetooth is enabled, and sensor data is sent to android application. If disabled, sensor data is directed only to the UART. If you are using the UART to make print to the PC/laptop, here are the settings your TCP client must be set too. Following is the UART configuration.

  Select COM Port
  Baud rate: 9600
  Data: 8 bit
  Parity: none
  Stop: 1 bit
  Flow Control: none


Figure shows when ADI_APP_USE_BLUETOOTH is set to 1

If you have the app installed on your phone, these figure shows the output on android device.

Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.

  1. Simply open up the IoTNode application on your phone.
  2. “Scan” for nearby demos.
  3. Once you find your demo, click on it to open it up.



Obtaining the Source Code

We recommend not opening the project directly, but rather use CrossCore Embedded Studio (CCES) example browse to open the project. Below screen shot shows how to open project from CCES Example browser.

The source code and include files of the ADICUP3029_ADT7420 demo can be found here:

How to use the Tools

The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.

Importing

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.

Debugging

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.

Project Structure

The ADICUP3029_ADT7420 is a C project that uses ADuCM3029 C/C++ Project structure.

This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; port configuration for I2C read/write; configuring and reading from ADT7420, UART read/write functions;


adt7420_app.cpp and adt7420_app.h are the main source and header files related to ADICUP3029_ADT7420 be found under RTE/ADuCM3029 folder.ADT7420 sensor software drivers are located in RTE/Sensor folder. All ADuCM3029 related drivers can BLE related files can be seen under RTE/Board_Support folder.
pinmux.c – contains GPIO pinmuxing for UART and SPI.



More Information

ADICUP3029 BLE Documentation

This is a guide with information regarding the BLE data packet size and configuration. This is will enable users to use the BLE IOS app in applications leveraging the capabilities of ADICUP3029 board with Bluetooth connectivity.

General Description/Overview

IOTnode application permits the connection of a single board at a time to visualize data from it. However multiple sensors may be present on that board (ex. temperature, CO, acceleration). The information sent to the application is tied to the sensor id.

The ADI BLE packet description currently has three types of packets:

Packet type Value
Registration packet 0x00
Name packet 0x01
Data packet 0x02

The packet type is specified using the packet type sensor id field.

The sensorID/packetType byte is composed of:

76543210
SID5SID4SID3SID2SID1SID0PKT1PKT0
Sensor ID Packet Type
6 bits 2 bits

You could have multiple sensors on a board with different ids the app shows information from one sensor at a time. It knows what information is related to which sensor by using the sensor id.

Registration Packet

Data Info Size(byte)
pktTypeSensorId registration packet 1
numFields must match No. of field name packets 1
dataType every field in the data packet must have this data type 1
sensorName string with the name of the sensor 17
SensorID value 6 bits
0x00 0b000000
to to
0x3F 0b111111
Data type value Description Size (bytes)
1 Byte 1
2 Short 2
3 Int 4
4 Long 8
5 Float 4
6 Double 8
7 Char 2

Field Name Packet

Data Info Size(byte)
pktTypeSensorId registration packet 1
fieldId index of field in data packet 1
fieldName string with the name of the sensor 18

Data Packet

Data Info Size(byte)
pktTypeSensorId registration packet 1
Sensor_Data1 Represents 4 bytes float data for field 1 4
Sensor_Data2 Represents 4 bytes float data for field 2 4
Sensor_Data3 Represents 4 bytes float data for field 3 4
Sensor_Data4 Represents 4 bytes float data for field 4 4

End of Document

10 Apr 2019 16:31 · mirceac

End of Document

resources/eval/user-guides/eval-adicup3029/reference_designs/demo_adt7420.txt · Last modified: 12 Apr 2019 14:45 by mirceac