This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | resources:eval:user-guides:eval-adicup360:reference_designs:demo_adt7420 [03 Jan 2017 20:55] – [General description] Brandon Bushey | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== ADT7420 PMOD Temperature Demo ====== | ||
+ | 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. | ||
+ | |||
+ | ===== General description ===== | ||
+ | |||
+ | This project is an example for how to use [[resources: | ||
+ | |||
+ | The ADuCM360_demo_adt7420_pmdz project uses the [[ADI> | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The application reads the temperature data from the ADT7420 and displays the temperature in **[codes]** and **[C]** on a serial terminal. | ||
+ | |||
+ | 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. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Setting up the hardware ===== | ||
+ | \\ | ||
+ | |||
+ | * To program the base board, set the jumpers as shown in the next figure. The important jumpers are highlighted in red. | ||
+ | {{: | ||
+ | |||
+ | * Plug the EVAL-ADT7420-PMDZ PMOD in the EVAL-ADICUP360 base board, via the PMOD_I2C port (P10). | ||
+ | |||
+ | * Power EVAL-ADICUP360 base board via the Debug USB. | ||
+ | |||
+ | \\ | ||
+ | ===== Obtaining the source code ===== | ||
+ | \\ | ||
+ | |||
+ | We recommend not opening the project directly, but rather import it into Eclipse and make a local copy in your Eclipse workspace. | ||
+ | |||
+ | To learn how to import the **ADuCM360_demo_adt7420_pmdz** project form the projects examples in the Git repository, please click on [[resources: | ||
+ | |||
+ | The source code and include files of the **ADuCM360_demo_adt7420_pmdz** can be found on Github: | ||
+ | |||
+ | <WRAP round 80% download> | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | ===== Importing the ADuCM360_demo_adt7420_pmdz project ===== | ||
+ | \\ | ||
+ | The necessary instructions on how to import **ADuCM360_demo_adt7420_pmdz** project in your workspace can be found in the section, [[resources: | ||
+ | |||
+ | \\ | ||
+ | ===== Debugging the ADuCM360_demo_adt7420_pmdz project ===== | ||
+ | \\ | ||
+ | * A debug configuration must be set up for this project in order to have the possibility to program and to debug the **ADuCM360_demo_adt7420_pmdz** project. To do this, follow the instructions from [[resources: | ||
+ | |||
+ | * Make sure the target board is connected to the computer (via **DEBUG USB**) and using the tool bar, navigate to the small Debug icon{{: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | * Use step-by-step execution or directly run the program. | ||
+ | |||
+ | After completion of the steps above the program will remain written into the system flash and it will run by default every time the board is powered up. | ||
+ | |||
+ | \\ | ||
+ | ===== Project structure ===== | ||
+ | \\ | ||
+ | The **ADuCM360_demo_adt7420_pmdz** project use basic ARM Cortex-M C/C++ 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 // | ||
+ | * **ADT7420 Configuration Register** - // | ||
+ | < | ||
+ | |||
+ | uint8_t ui8configAdt7420 = (FAULT_TRIGGER_4 | CT_PIN_POLARITY | INT_PIN_POLARITY | INT_CT_MODE |CONTINUOUS_CONVERSION_MODE | RESOLUTION_13_BITS); | ||
+ | |||
+ | /** | ||
+ | #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 | ||
+ | |||
+ | #define CT_PIN_POLARITY - Critical temp active logic level | ||
+ | #define INT_PIN_POLARITY - Interrupt temp active logic level | ||
+ | #define INT_CT_MODE - Selects comparator or interrupt 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 | ||
+ | |||
+ | #define RESOLUTION_13_BITS - 13-bit Temperature data | ||
+ | #define RESOLUTION_16_BITS - 16-bit Temperature data | ||
+ | |||
+ | **/ | ||
+ | </ | ||
+ | \\ | ||
+ | * **ADT7420 I2C Address**- // | ||
+ | < | ||
+ | |||
+ | #define ADT7420_ADDRESS | ||
+ | |||
+ | </ | ||
+ | * **High Temperature Interrupt** - // | ||
+ | < | ||
+ | |||
+ | #define TEMP_HIGH_SETPOINT | ||
+ | |||
+ | </ | ||
+ | * **Low Temperature Interrupt** - // | ||
+ | < | ||
+ | |||
+ | #define TEMP_LOW_SETPOINT | ||
+ | |||
+ | </ | ||
+ | |||
+ | * **Critical Temperature Interrupt** - // | ||
+ | < | ||
+ | |||
+ | #define TEMP_CRITICAL_SETPOINT | ||
+ | |||
+ | </ | ||
+ | |||
+ | * ** Temperature Hysteresis** - // | ||
+ | < | ||
+ | |||
+ | #define TEMP_HYSTERSIS_SETPOINT | ||
+ | |||
+ | </ | ||
+ | \\ | ||
+ | The **system** folder contains system related files (try not to change these files): | ||
+ | * **ADuCM360** – contains low levels drivers for ADuCM360 microcontroller. | ||
+ | * **CMSIS** – contains files related to ADuCM360 platform, such as: // | ||
+ | * **cortexm** – contains files for system management (start-up, reset, exception handler). | ||
+ | \\ |