Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:product-support-software:sigma-delta_adc_temperature-ble_demo [19 May 2020 12:27] – Final draft1 Mahesh Phalkeresources: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 [[https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EV-COG-AD3029.html#eb-overview | 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 ADIs  [[https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EV-COG-AD3029.html#eb-overview | ADuCM3029 Cog board]] and [[https://wiki.analog.com/resources/eval/user-guides/ev-cog-bleintp1z | 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>en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EV-COG-AD3029.html#eb-overview | 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 ADIs  [[adi>en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EV-COG-AD3029.html#eb-overview | ADuCM3029 Cog board]] and [[/resources/eval/user-guides/ev-cog-bleintp1z | Bluetooth Eval board]]. The operation can be better illustrated using below diagram.
  
  
Line 16: Line 16:
 {{ :resources:tools-software:product-support-software:ad7124_temp_sensing.jpg?400 |}} {{ :resources:tools-software:product-support-software:ad7124_temp_sensing.jpg?400 |}}
  
-[[https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/eval-ad7124-8.html | AD7124 Eval board]] has default on-board KTY-81/110 RTD sensor (silicon Thermistor) connected between analog inputs AIN4 and AIN5. However, for the complete RTD measurement, the precision resistor (Rref) needs to be connectd externally along with Rhead headroom resistor. Rref needs to have 0.1% precision for complete accuracy. The choice of this reference resistor depends upon the Ref output voltage and excitation current. Use below application note for more details on the temperature sensing using RTD:+[[adi>en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/eval-ad7124-8.html | AD7124 Eval board]] has default on-board KTY-81/110 RTD sensor (silicon Thermistor) connected between analog inputs AIN4 and AIN5. However, for the complete RTD measurement, the precision resistor (Rref) needs to be connectd externally along with Rhead headroom resistor. Rref needs to have 0.1% precision for complete accuracy. The choice of this reference resistor depends upon the Ref output voltage and excitation current. Use below application note for more details on the temperature sensing using RTD:
  
-[[https://www.analog.com/media/en/reference-design-documentation/reference-designs/CN0381.pdf| RTD Measurement System Using a Precision Sigma-Delta ADC]]+[[adi>media/en/reference-design-documentation/reference-designs/CN0381.pdf| RTD Measurement System Using a Precision Sigma-Delta ADC]]
  
  
 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: 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:
  
-[[https://www.analog.com/media/en/reference-design-documentation/reference-designs/CN0384.pdf| Thermocouple Measurement System Using a Precision Sigma-Delta ADC]]+[[adi>media/en/reference-design-documentation/reference-designs/CN0384.pdf| Thermocouple Measurement System Using a Precision Sigma-Delta ADC]]
  
  
Line 55: Line 55:
 === 2) Interfacing ADuCM3029 Cog Board with Sigma Delta ADCs/Eval Board === === 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 [[https://wiki.analog.com/resources/eval/user-guides/ev-gear-expander1z | Gear Expander board]]. Depending upon the digital interface used on Sigma Delta ADCs, the connection could be either 4 line SPI or 3 line I2C. The connection can be done either using [[https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/sdp-breakout-board.html | SDP breakout board]] or by directly soldering fly wires from the ADC Evaluation board to ADuCM3029 Expander Gear board. The sample connection for the AD7124 Eval board with COG board is shown below using a fly wires. The wires are directly soldered on the Eval board, but for better connection, use the SDP breakout board:+The ADuCM3029 COG board is connected to Sigma Delta ADC Eval board using a [[/resources/eval/user-guides/ev-gear-expander1z | Gear Expander board]]. Depending upon the digital interface used on Sigma Delta ADCs, the connection could be either 4 line SPI or 3 line I2C. The connection can be done either using [[adi>en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/sdp-breakout-board.html | SDP breakout board]] or by directly soldering fly wires from the ADC Evaluation board to ADuCM3029 Expander Gear board. The sample connection for the AD7124 Eval board with COG board is shown below using a fly wires. The wires are directly soldered on the Eval board, but for better connection, use the SDP breakout board:
  
 {{ :resources:tools-software:product-support-software:aducm3029-ad7124_eval.jpg?400 |}} {{ :resources:tools-software:product-support-software:aducm3029-ad7124_eval.jpg?400 |}}
Line 66: Line 66:
 === 3) Interfacing ADuCM3029 Cog Board with Bluetooth Eval Board === === 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 [[https://wiki.analog.com/resources/eval/user-guides/ev-cog-bleintp1z | user manual]] for more details on the hardware connection:+The below diagrams shows the connection between ADuCM3029 COG Board and Bluetooth Eval board. There are no additional jumper settings needed. Please refer [[/resources/eval/user-guides/ev-cog-bleintp1z | user manual]] for more details on the hardware connection:
  
 == Primary-side == == Primary-side ==
Line 73: Line 73:
 == Secondary-side == == Secondary-side ==
 {{ :resources:eval:user-guides:eval-cog-ad3029lz:picture2.png?nolink&400 |}} {{ :resources:eval:user-guides:eval-cog-ad3029lz:picture2.png?nolink&400 |}}
 +
 +
 +=== 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, including ADT7420 Temperature sensor, ADXL362 Accelerometer, Push buttons and LEDs, SD Card, Wi-Fi/RF interface, etc. The firmware interface with ADT7420 temperature sensor and ADXL362 accelerometer to transmit sensor data. Also, it uses Push button PB1 to come out of Hibernate mode, which is tied to External Interrupt 1 pin. The ADXL362 interrupt ativity pin is tied to external interrupt 2. Both these interrupts are used by MCU to come out of hibernate mode.
 +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.
  
  
Line 81: Line 87:
 <WRAP round download> <WRAP round download>
 Latest firmware (Use below link): Latest firmware (Use below link):
-  * [[ | Sigma Delta ADC Temperature-BLE Demo Firmware Example]]+  * [[ https://github.com/analogdevicesinc/EV-COG-AD3029LZ/tree/master/sd-adc_cces_temperature-to-ble%20Example | Sigma Delta ADC Temperature-BLE Demo Firmware Example]]
 </WRAP> </WRAP>
  
 ==== Development Tools ==== ==== Development Tools ====
-The firmware uses Analog Devices [[https://www.analog.com/en/design-center/evaluation-hardware-and-software/software/adswt-cces.html | Cross Core Embedded Studio (CCES)]] as a development IDE, with in-built ARM GCC compiler. To develop CCES ARM based project, follow below wiki page guidelines:+The firmware uses Analog Devices [[adi>en/design-center/evaluation-hardware-and-software/software/adswt-cces.html | Cross Core Embedded Studio (CCES)]] as a development IDE, with in-built ARM GCC compiler. To develop CCES ARM based project, follow below wiki page guidelines:
  
 https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/tools/cces_user_guide
Line 91: Line 97:
 ==== Code Structure ==== ==== Code Structure ====
 {{ :resources:tools-software:product-support-software:sd-adc_temp-ble_software_structure.jpg?700 |}} {{ :resources:tools-software:product-support-software:sd-adc_temp-ble_software_structure.jpg?700 |}}
 +
 +
 +The tempsensor project is compiled externally to BLE demo firmware project. The "libtempsensors.a" library file generated by this project is used during linking time in "sd-adc_cces_temperature-to-ble" project. So, when compiling the project, both these project must be present in same workspace.
 +
 +{{ :resources:tools-software:product-support-software:sd-adc_ble_cces_settings.jpg?600 |}}
  
  
 ==== Using the Firmware ==== ==== Using the Firmware ====
 +
 +=== Device Linker File Configuration (ADuCM3029.ld) ===
 +
 +Because of the hibernate mode implementation, the device linker file has been modified to map the .data and .bss sections of memory to Bank0 and Bank1 of SRAM. The MCU in hibernate does not retain the contents of upper 16Kbytes of SRAM (Bank 3,4 and 5). Hence to avoid loosing data, it is necessary to map the data and bss sections to DSRAM_A in linker configuration file.
 +
 +//*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
 +</code>
 +
 +
 +=== 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
 +</code>
  
 === main.cpp === === 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 either Low Energy Bluetooth Link Or UART link.+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 can be done by commenting/uncommenting below macro:+The selection b/w UART or Bluetooth dispatcher service can be done by commenting/uncommenting below macro. The UART link is also used to log the debug messages and so even with Bluetooth dispatcher service, you should be able to see all debug and sensor data messages on UART link.
  
 <code c> <code c>
Line 118: Line 166:
  * The following interrupts can can wake the processor  * The following interrupts can can wake the processor
  * BTN1 - user initiates sample  * BTN1 - user initiates sample
- * BTN2 - user changes sampleEngine Temperature selection 
  * Axl  - acceleration threshold exceeded, triggers a Sample and transmit data  * Axl  - acceleration threshold exceeded, triggers a Sample and transmit data
     RTC  - Sample and transmit data on a periodic basic     RTC  - Sample and transmit data on a periodic basic
 + *
 + * 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), so that data is retained when
 + * 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 */ /* enter full hibernate mode with no wakeup flag (always go back to sleep) and no masking */
 if (adi_pwr_EnterLowPowerMode(ADI_PWR_MODE_HIBERNATE, &iHibernateExitFlag, 0)) { if (adi_pwr_EnterLowPowerMode(ADI_PWR_MODE_HIBERNATE, &iHibernateExitFlag, 0)) {
  DEBUG_MESSAGE("System Entering to Low Power Mode failed");  DEBUG_MESSAGE("System Entering to Low Power Mode failed");
 } }
 +
 +/* Perform the operations needed after exit from hibernate mode */
 +do_post_hibernate_exit_operations();
 </code> </code>
  
Line 150: Line 213:
 ==== Dispatching Data Over Bluetooth/UART Link ==== ==== Dispatching Data Over Bluetooth/UART Link ====
  
-Depending upon the Bluetooth Or UART link config selection in the main.cpp file, the sensor data is dispatched over Bluetooth Or UART link. 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:+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://apps.apple.com/us/app/iotnode/id1242751625#?platform=iphone https://apps.apple.com/us/app/iotnode/id1242751625#?platform=iphone
Line 169: Line 232:
  
 <note tip> <note tip>
-This page might not cover the all minute details of hardware/software configuration and operation. All the necessary links for the associated documents are provided above. Feel free to consult Analog Devices [[https://www.analog.com/engineerzone|Engineer-Zone]] for feature requests, feedback, bug-reports etc.+This page might not cover the all minute details of hardware/software configuration and operation. All the necessary links for the associated documents are provided above. Feel free to consult Analog Devices [[adi>engineerzone|Engineer-Zone]] for feature requests, feedback, bug-reports etc.
 </note> </note>
resources/tools-software/product-support-software/sigma-delta_adc_temperature-ble_demo.1589884048.txt.gz · Last modified: 19 May 2020 12:27 by Mahesh Phalke