Friday, November 21, 2014

DS18B20 1W Digital Thermometer

This blog will be a record of developing an Arduino circuit to use the Maxim DS18B20. The intention is to learn some assembly (ASM) language, how network protocol is implemented (including both the software portion of the protocol to correctly interpret the stream of bytes to and from the DS18B20 and the hardware portion of the protocol to correctly set up the timing of the data signals so the the data signals are correcly interpreted both by the Arduino (or microcontroller, or MCU) and by the DS8B20.

The Maxim DS18B20 includes the following features that will need to be dealt with in the code:

  • Programmable resolution of the temperature read out data (9, 10, 11 of 12 bits of data, giving temperature resolutions of 0.5, 0.25, 0.125, 0.0625C)
  • Temperature alarms (upper and lower) with levels programmable by the User
  • CRC (Cyclic Redundancy Check) to check for data integrity
  • 48 bit address so millions of devices can be individually accessed (the datasheet says 64 bits but some of the bits are not part of the individual device address: 8 bits are fixed at 0x28 to designate that the part is a DS18B20; 8 bits are used for a CRC of the 48 bits actually used for the address)
  • 1-Wire interface for both power and data communication (it is not necessary to use this feature as there is a separate pin for Vdd