Microchip | The Embedded Control Solutions Company Register Login
Browse All
MAGETEX
 6 Code Snippets

Library work with temperature sensors DS18B20.

MAGETEX

We are sorry to use a machine translation. Sensors of temperature DS18B20 proved as reliable and inexpensive devices of change of temperature. Together with firm Microchip controllers allow to create inexpensive monitoring systems and temperature regulations. The construction of port of input of an output of the microcontroller allows to connect immediately sensors with removal to 300 Meters, without what or drivers.

About this Code Example

We are sorry to use a machine translation.

Sensors of temperature DS18B20 proved as reliable and inexpensive devices of change of temperature. Together with firm Microchip controllers allow to create inexpensive monitoring systems and temperature regulations. The construction of port of input of an output of the microcontroller allows to connect immediately sensors with removal to 300 Meters, without what or drivers. Operation possibility in a network mode and property of the bus 1-Wirej allow to use only one output of the microcontroller.


Library functions.
Level_High ()
Forms high level on the bus.
Level_Low ()
Forms low level.
Waiting_WR ()
Forms a latent period for a data bit read or write.
CRC_Bits (int data)
Calculation of the control total for the data received with DS18B20.
Reset_Dallas ()
Forms reset pulse on the data bus.
Dreceive ()
Reads byte of the data from DS18B20.
Dsend ()
Writes down byte of the data on DS18B20.
Celsio ()
Does everything that is necessary for temperature measurement. Returned value shows
bus state 1-Wirej. And also supervises serviceability and installs (сбрасыват) flags of
malfunction of sensors of temperature.
SeachROM ()
Function of search of addresses of sensors of temperature connected to the bus.
SaveROM ()
Function of saving of addresses of sensors of temperature in EEPROM. Clever function it
adds sensors and produces changeover of addresses of the damaged sensors by
serviceable sensors.
EraseROM ()
Clears storage EEPROM of addresses of sensors. It is necessary if it is necessary to "make
a fresh start".
Test_DT ()
This function unites in itself all necessary procedure on initial testing and control over
temperature sensors. It normally allocate in фунцкии controler initialization at supply
switching-on.

links

Video

Categories

Release History

  • Sep 13, 2012

    Version: 1.0.1

    Library with temperature sensors DS18B20.

Download Contact the Developer

*Required Fields

  • Current Version:1.0.1
  • Created:Sep 14, 2012
  • Updated:Feb 26, 2015
  • Downloads:5942
  • MPLAB Version:v8.87
  • C Compiler:HI-TECH C Compiler for PIC18 MCUs (PRO Mode) V9.80
  • Development Tools:icd2, icd3
  • Supported Devices:pic16, pic18

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.