This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:product-support-software:sigma-delta_adc_temperature-ble_demo [18 May 2020 14:19] – Added description Mahesh Phalke | resources:tools-software:product-support-software:sigma-delta_adc_temperature-ble_demo [14 Jan 2021 05:38] (current) – use wiki interwiki links Robin Getz | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This page gives an overview of using the Analog Devices Sigma Delta ADCs with Cortex-M3 ARM processor based ADuCM3029 Cog Eval Board. The intended demo application shows how to convert an external sensor data into actual units and transmit them over either Bluetooth or UART link using ADuCM3029 Cog board and Bluetooth Eval board. The operation can be better illustrated using below diagram. | + | This page gives an overview of using the Analog Devices Sigma Delta ADCs with Cortex-M3 ARM processor based [[adi> |
{{ : | {{ : | ||
+ | ===== Interface Overview ===== | ||
+ | |||
+ | === 1) Temperature Sensing using Sigma Delta ADCs === | ||
+ | |||
+ | |||
+ | The below diagram shows the temperature sensing scheme using AD7124 Sigma Delta ADC. It uses T-Type thermocouple and 2-wire RTD sensors as an external analog inputs. The Thermocouple acts as a hot junction and RTD as a cold junction compensation. This combination provides a precise measurements of ambient temperature over a very wide range. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | [[adi> | ||
+ | |||
+ | [[adi> | ||
+ | |||
+ | |||
+ | Thermocouple needs to be connected externally between analog inputs AIN2 and AIN3. Use below application note for more details on the temperature sensing using Thermocouple: | ||
+ | |||
+ | [[adi> | ||
+ | |||
+ | |||
+ | |||
+ | For temperature sensing using AD7124 Eval board and ADuCM3029 COG board please use below software and hardware configuration: | ||
+ | |||
+ | |||
+ | == T-Type Thermocouple (Chn0): == | ||
+ | |||
+ | * AINP: AIN2, AINM: AIN3 | ||
+ | * PGA Gain: 128 | ||
+ | * Internal Vref Enabled | ||
+ | * Vbias enabled on AIN3 | ||
+ | |||
+ | == RTD Thermistor (Chn1): == | ||
+ | |||
+ | * AINP: AIN4, AINM: AIN5 | ||
+ | * PGA Gain: 8 | ||
+ | * REFIN1+ and REFIN1- Enabled | ||
+ | * Excitation current set to 100uA on AIN2 (Iout0) pin | ||
+ | * Precision Reference: 22 Kohm and Rheadroom: 250 Ohm | ||
+ | |||
+ | == Other Jumper Setting: == | ||
+ | |||
+ | * LK3, LK4 and LK5 Removed | ||
+ | * LK6 both inserted | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | |||
+ | === 2) Interfacing ADuCM3029 Cog Board with Sigma Delta ADCs/Eval Board === | ||
+ | |||
+ | The ADuCM3029 COG board is connected to Sigma Delta ADC Eval board using a [[/ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | |||
+ | === 3) Interfacing ADuCM3029 Cog Board with Bluetooth Eval Board === | ||
+ | |||
+ | The below diagrams shows the connection between ADuCM3029 COG Board and Bluetooth Eval board. There are no additional jumper settings needed. Please refer [[/ | ||
+ | |||
+ | == Primary-side == | ||
+ | {{ : | ||
+ | |||
+ | == Secondary-side == | ||
+ | {{ : | ||
+ | |||
+ | |||
+ | === 4) Leveraging ADuCM3029 Cog On-Board Peripherals === | ||
+ | |||
+ | In addition to Sigmal Delta ADC interface and Bluetooth interface, the ADuCM3029 has number of on-board peripherals, | ||
+ | The PB2 is used to select the next sensor scanning and must be pressed when MCU is awake. This can be done by pressing PB1 first and them immediately PB2, which will first take MCU out of hibernate mode and then will select next sensor for sampling. | ||
+ | |||
+ | |||
+ | ===== Firmware Overview ===== | ||
+ | |||
+ | ==== Downloads ==== | ||
+ | |||
+ | <WRAP round download> | ||
+ | Latest firmware (Use below link): | ||
+ | * [[ https:// | ||
+ | </ | ||
+ | |||
+ | ==== Development Tools ==== | ||
+ | The firmware uses Analog Devices [[adi> | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ==== Code Structure ==== | ||
+ | {{ : | ||
+ | |||
+ | |||
+ | The tempsensor project is compiled externally to BLE demo firmware project. The " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | ==== Using the Firmware ==== | ||
+ | |||
+ | === Device Linker File Configuration (ADuCM3029.ld) === | ||
+ | |||
+ | Because of the hibernate mode implementation, | ||
+ | |||
+ | //*Note: This has already been done in the distributed firmware. In case, you are not using hibernate mode, you can revert it back to DSRAM_B (the default one).// | ||
+ | |||
+ | <code c> | ||
+ | .data : AT (__etext) | ||
+ | { | ||
+ | . | ||
+ | . | ||
+ | } > DSRAM_A | ||
+ | |||
+ | .bss : | ||
+ | { | ||
+ | . | ||
+ | . | ||
+ | } > DSRAM_A | ||
+ | </ | ||
+ | |||
+ | |||
+ | === CMSIS Compatibility (startup_ADuCM3029.c) === | ||
+ | |||
+ | The ADuCM3029 software package startup file is not yet updated to support latest changes in the ARM CMSIS drivers (CMSIS-CORE (M) Version 5.3.0 and above) and it creates conflicts in the startup_ADuCM3029.c file for duplicate identifiers. To avoid this conflict, startup file is modified as below: | ||
+ | <code c> | ||
+ | #if __CM_CMSIS_VERSION < 0x050003 | ||
+ | // For CMSIS-CORE(M) version 5.3.0 above, the below variables have defined | ||
+ | // with different data types in cmsis_gcc.h file from the device CMSIS pack. | ||
+ | // The ADuCM3029 start-up code is not yet up-to-date with the latest changes from | ||
+ | // the CMSIS pack. Hence commenting below code to avoid compilation errors. | ||
+ | extern uint32_t __copy_table_start__; | ||
+ | extern uint32_t __copy_table_end__; | ||
+ | extern uint32_t __zero_table_start__; | ||
+ | extern uint32_t __zero_table_end__; | ||
+ | #endif | ||
+ | </ | ||
+ | |||
+ | === main.cpp === | ||
+ | |||
+ | The entry point to firmware is defined in main.cpp file (a main function). This function is responsible for initializing and configuring the system peripherals. This module is also responsible for getting the sensor data from sampling engines and dispatch it over Low Energy Bluetooth Link or/and UART link. | ||
+ | |||
+ | The selection b/w UART or Bluetooth dispatcher service can be done by commenting/ | ||
+ | |||
+ | <code c> | ||
+ | /* Select communication mode. Comment below to select UART as default com mode */ | ||
+ | //#define ADI_BLUETOOTH_COMM | ||
+ | </ | ||
+ | |||
+ | The following sensors are used in the firmware and data from them is dispatched over UART/ | ||
+ | - Thermocouple + RTD (Temperature Sensor interfaced with Sigma Delta ADC e.g AD7124) | ||
+ | - ADT7420 (ADuCM3029 COG On-Board Temperature Sensor) | ||
+ | - ADXL362 (ADuCM3029 COG On-Board Accelerometer Sensor) | ||
+ | |||
+ | |||
+ | The processor is put into hibernate sleep mode after every frame transmission for 10sec timeout period. This is handled in main.cpp module as below: | ||
+ | <code c> | ||
+ | /* | ||
+ | * This puts the processor into hibernation mode, waiting for interrupts | ||
+ | * The following interrupts can can wake the processor | ||
+ | * BTN1 - user initiates sample | ||
+ | * Axl - acceleration threshold exceeded, triggers a Sample and transmit data | ||
+ | | ||
+ | * | ||
+ | * Before entering into hibernate mode, all the used peripherals must be | ||
+ | * disable. Once the hibernate mode is exited by one of the above mentioned | ||
+ | * interrupts, the peripherals which were disabled before, must be enabled again. | ||
+ | * | ||
+ | * In addition to that, when device exits from hibernate mode, by default | ||
+ | * only the Bank0/Bank1 of data SRAM is retained. Therefore it is required | ||
+ | * to map .data and .bss sections of memory to Bank0/1 of SDRAM in the device | ||
+ | * linker file of the project (ADuCM3029.ld), | ||
+ | * controller comes out of hibernate mode. | ||
+ | */ | ||
+ | /* Perform the operations needed before entering into hibernate mode */ | ||
+ | do_pre_hibernate_entry_operations(); | ||
+ | |||
+ | /* enter full hibernate mode with no wakeup flag (always go back to sleep) and no masking */ | ||
+ | if (adi_pwr_EnterLowPowerMode(ADI_PWR_MODE_HIBERNATE, | ||
+ | DEBUG_MESSAGE(" | ||
+ | } | ||
+ | |||
+ | /* Perform the operations needed after exit from hibernate mode */ | ||
+ | do_post_hibernate_exit_operations(); | ||
+ | </ | ||
+ | |||
+ | |||
+ | === app_config.h === | ||
+ | |||
+ | This file allows user to select active Sigma Delta ADC that is used for external temperature sensing: | ||
+ | <code c> | ||
+ | // **** Note for User: Active Device selection **** | ||
+ | // Select the device type from the list of below device type defines | ||
+ | // e.g. #define DEV_AD7124 -> This will make AD7124 as an Active Device. | ||
+ | // The Active Device is default set to AD7124, if device type is not defined. | ||
+ | |||
+ | #if defined DEV_AD7124 | ||
+ | #define ACTIVE_DEVICE ID_AD7124 | ||
+ | #else | ||
+ | #warning "No active device defined. AD7124 selected as default device" | ||
+ | #define DEV_AD7124 | ||
+ | #define ACTIVE_DEVICE ID_AD7124 | ||
+ | #endif | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Dispatching Data Over Bluetooth/ | ||
+ | |||
+ | The Bluetooth sensor data can be captured using a Analog Devices IoT node smart IOS application (for IOS/apple based devices). The application can be downloaded from below link: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | The more information about the bluetooth packet format is provided below: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | For observing data using UART link using serial terminal (e.g. [[https:// | ||
+ | * Baud rate: 115200 | ||
+ | * Data bits: 8-bits | ||
+ | * Parity: None | ||
+ | * Stop bits: 1 | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <note tip> | ||
+ | This page might not cover the all minute details of hardware/ | ||
+ | </ |