The ADuCM360_demo_adt7420_pmdz is a temperature demo project for the EVAL-ADICUP360 base board with an EVAL-ADT7420-PMDZ PMOD board from Analog Devices, using the GNU ARM Eclipse Plug-ins in Eclipse environment.
This project is an example for how to use EVAL-ADICUP360 board in combination with the EVAL-ADT7420-PMDZ Temperature PMOD.
The ADuCM360_demo_adt7420_pmdz project uses the EVAL-ADT7420-PMDZ which has the ADT7420 0.25 degree accurate digital temperature sensor on board.
The application reads the temperature data from the ADT7420 and displays the temperature in [codes] and [C] on a serial terminal. The temperature data can be changed between 16-bit(0.0078 C/LSB) and 13-bit(0.0625 C/LSB) accurate depending on the resolution needed. The application also prints out the device ID register, which is just a quick and easy check to ensure the reads are working properly.
All the outputs are printed from the UART to the USER USB port using P0.6 and P0.7, and can be read on the PC using a serial terminal program, such as Putty or Tera Term. The user must ensure that the USB cable is connected to the USER USB port in order to read back values in Putty. Also, the user must press the
The following is a list of items needed in order to replicate this demo.
We recommend not opening the project directly, but rather import it into CCES and make a local copy in your workspace.
The source code and include files of the ADuCM360_demo_adt7420_pmdz can be found on Github:
CrossCore Embedded Studio Application Source Code:
AduCM360_demo_adt7420_pmdz at Github
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
Configure the ADT7420 I2C address in the ADT7420.h file to match the hardware.
/* ADT7420 I2C Address */ #define ADT7420_ADDRESS 0x48 /* Default I2C Address of EVAL-ADT7420-PMDZ */
Configure the ADT7420 in the operating mode you want using the ADT7420.c file
uint8_t ui8configAdt7420 = (FAULT_TRIGGER_4 | CT_PIN_POLARITY | INT_PIN_POLARITY | INT_CT_MODE |CONTINUOUS_CONVERSION_MODE | RESOLUTION_13_BITS); /* False Trigger Count */ #define FAULT_TRIGGER_1 /* 1 fault reading triggers an interrupt */ #define FAULT_TRIGGER_2 /* 2 fault readings triggers an interrupt */ #define FAULT_TRIGGER_3 /* 3 fault readings triggers an interrupt */ #define FAULT_TRIGGER_4 /* 4 fault readings triggers an interrupt */ /* Alarm Logic Levels */ #define CT_PIN_POLARITY /* Critical temp active logic level */ #define INT_PIN_POLARITY /* Interrupt temp active logic level */ /* Interrupt Mode */ #define INT_CT_MODE /* Selects comparator or interrupt mode */ /* Conversion Mode */ #define CONTINUOUS_CONVERSION_MODE /* Continuous conversion */ #define ONE_SHOT_MODE /* One shot conversion, then shuts down */ #define ONE_SAMPLE_PER_SECOND_MODE /* One second between readings */ #define SHUTDOWN_MODE /* Power down mode activated */ /* Resolution */ #define RESOLUTION_13_BITS /* 13-bit Temperature data */ #define RESOLUTION_16_BITS /* 16-bit Temperature data */
Assign values to your different temperature setpoints and alarms/interrupts in the ADT7420.h file
/* Temperature monitoring parameters */ #define TEMP_HIGH_SETPOINT 75 /* Value in Degree C */ #define TEMP_LOW_SETPOINT 0 /* Value in Degree C */ #define TEMP_CRITICAL_SETPOINT 100 /* Value in Degree C */ #define TEMP_HYSTERSIS_SETPOINT 5 /* Value in Degree C */
Following is the UART configuration.
Select COM Port Baud rate: 9600 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
The user must press the
The official tool we promote for use with the EVAL-ADICUP360 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.
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.
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.
This is the ADuCM360_demo_adt7420_pmdz project structure.
This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripheral; port configuration for I2C, temperature sensor data; I2C read/write functions; threshold monitoring.
In the src and include folders you will find the source and header files related to adt7420_pmdz application. You can modify those files as appropriate for your application. The Communication.c/h files contain I2C and UART specific data, meanwhile the ADT7420.c/h files contain the temperature information data and threshold registers. Here are parameters you can configure:
The RTE folder contains device and system related files:
End of Document
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !