×

ADT7420-适用于单片机平台的无操作系统驱动程序

消耗积分:2 | 格式:pdf | 大小:1.6MB | 2021-04-23

分享资料个

This version (22 Jul 2019 14:32) was approved by Andrei Drimbarean.The Previously approved version (28 Jun 2013 09:33) is available.Diff

ADT7420 - No-OS Driver for Microchip Microcontroller Platforms

Supported Devices

Evaluation Boards

Overview

The ADT7420 is a high accuracy digital temperature sensor offering breakthrough performance over a wide industrial range, housed in an LFCSP package. It contains a band gap temperature reference and a 13-bit ADC to monitor and digitize the temperature to a 0.0625°C resolution. The ADC resolution, by default, is set to 13 bits (0.0625°C). This can be changed to 16 bits (0.0078°C) by setting Bit 7 in the configuration register to 1 (Register Address 0x03). The ADT7420 is guaranteed to operate over supply voltages from 2.7 V to 5.5 V. Operating at 3.3 V, the average supply current is typically 210 μA. The ADT7420 has a shutdown mode that powers down the device and offers a shutdown current of typically 2 μA. The ADT7420 is rated for operation over the −40°C to +150°C temperature range.

Pin A0 and Pin A1 are available for address selection, giving the ADT7420 four possible I2C addresses. The CT pin is an open-drain output that becomes active when the temperature exceeds a programmable critical temperature limit. The default critical temperature limit is 147°C. The INT pin is also an open-drain output that becomes active when the temperature exceeds a programmable limit. The INT and CT pins can operate in either comparator or interrupt mode.

Applications

  • RTD and thermistor replacement
  • Medical equipment
  • Cold junction compensation
  • Industrial control and test
  • Food transportation and storage
  • Environmental monitoring and HVAC

28 Sep 2012 16:29 · Dragos Bogdan

The goal of this project (Microcontroller No-OS) is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. Here you can find a generic driver which can be used as a base for any microcontroller platform and also specific drivers for different microcontroller platforms.

Driver Description

The driver contains two parts:

  • The driver for the ADT7420 part, which may be used, without modifications, with any microcontroller.
  • The Communication Driver, where the specific communication functions for the desired type of processor and communication protocol have to be implemented. This driver implements the communication with the device and hides the actual details of the communication protocol to the ADI driver.

The Communication Driver has a standard interface, so the ADT7420 driver can be used exactly as it is provided.

There are three functions which are called by the ADT7420 driver:

  • I2C_Init() – initializes the communication peripheral.
  • I2C_Write() – writes data to the device.
  • I2C_Read() – reads data from the device.

I2C driver architecture

The implementation of these three functions depends on the used microcontroller.

The following functions are implemented in this version of ADT7420 driver:

Function Description
unsigned char ADT7420_GetRegisterValue(unsigned char registerAddress) Reads the value of a register.
void ADT7420_SetRegisterValue(unsigned char registerAddress, unsigned char registerValue) Sets the value of a register.
char ADT7420_Init(void) Initializes the comm. peripheral and checks if the device is present.
void ADT7420_Reset(void) Resets the ADT7420.
void ADT7420_SetOperationMode(unsigned char mode) Sets the operational mode for ADT7420.
void ADT7420_SetResolution(unsigned char resolution) Sets the resolution for ADT7420.
float ADT7420_GetTemperature(void) Reads the temperature data and converts it to Celsius degrees.
01 Oct 2012 15:27 · Dragos Bogdan

Downloads

Digilent Cerebot MX3cK Quick Start Guide

This section contains a description of the steps required to run the ADT7420 demonstration project on a Digilent Cerebot MX3cK platform.

Required Hardware

Required Software

The ADT7420 demonstration project for PIC32MX320F128H consists of three parts: the ADT7420 Driver, the PmodTMP2 Demo for PIC32MX320F128H and the PIC32MX320F128H Common Drivers.

All three parts have to be downloaded.

Hardware Setup

A PmodTMP2 has to be connected to the J2 connector of Cerebot MX3cK development board.

Reference Project Overview

The following commands were implemented in this version of ADT7420 reference project for Cerebot MX3cK board.

Command Description
help? Displays all available commands.
reset! Resets the ADT7420.
mode= Sets the operational mode for ADT7420. Accepted values:
0 - Continuos conversions.
1 - One shot.
2 - 1 SPS mode.
3 - Shutdown.
mode? Displays the selected operational mode.
resolution= Sets the resolution for ADT7420. Accepted values:
0 - 13 bits resolution.
1 - 16 bits resolution.
resolution? Displays the selected resolution.
temperature? Displays the temperature in degrees Celsius.

Commands can be executed using a serial terminal connected to the UART1 peripheral of PIC32MX320F128H.

The following image shows a generic list of commands in a serial terminal connected to processor’s UART peripheral.

Software Project Setup

This section presents the steps for developing a software application that will run on the Digilent Cerebot MX3cK development board for controlling and monitoring the operation of the ADI part.

  • Run the MPLAB X integrated development environment.
  • Choose to create a new project.
  • In the Choose Project window select Microchip Embedded category, Standalone Project and press Next.

  • In the Select Device window choose PIC32MX320F128H device and press Next.

  • In the Select Tool window select the desired hardware tool and press Next.

  • In the Select Compiler window chose the XC32 compiler and press Next.

  • In the Select Project Name and Folder window choose a name and a location for the project.

  • After the project is created, all the downloaded source files have to be copied in the project folder and included in the project.

  • The project is ready to be built and downloaded on the development board.

05 Jul 2012 14:45

Digilent Cerebot MC7 Quick Start Guide

This section contains a description of the steps required to run the ADT7420 demonstration project on a Digilent Cerebot MC7 platform.

Required Hardware

Required Software

Hardware Setup

A PmodTMP2 has to be connected to the J6 connector of Cerebot MC7 development board.

Reference Project Overview

Following commands were implemented in this version of ADT7420 reference project for Cerebot MC7 board.

Command Description
help? Displays all available commands.
reset= Resets the ADT7420.
mode= Sets the operational mode for ADT7420. Accepted values: 0 - 3
mode? Displays the selected operational mode.
resolution= Sets the resolution for ADT7420. Accepted values: 0 - 1
resolution? Displays the selected resolution.
temp? Displays the temperature.

Commands can be executed using a serial terminal connected to the UART1 peripheral of dsPIC33FJ128MC706A.

The following image shows a list of commands in a serial terminal connected to processor’s UART peripheral.

Software Project Setup

This section presents the steps for developing a software application that will run on the Digilent Cerebot MC7 development board for controlling and monitoring the operation of the ADI part.

  • Run the MPLAB X integrated development environment.
  • Choose to create a new project.
  • In the Choose Project window select Microchip Embedded category, Standalone Project and press Next.

  • In the Select Device window choose dsPIC33FJ128MC706A device and press Next.

  • In the Select Tool window select the desired hardware tool and press Next.

  • In the Select Compiler window chose the XC16 compiler and press Next.

  • In the Select Project Name and Folder window choose a name and a location for the project.

  • After the project is created, the source files have to be copied in the project folder and included in the project.

  • The project is ready to be built and downloaded on the development board.

16 Jul 2012 16:48

More information

01 Jun 2012 12:17

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !