Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DS1624 - Digital Thermometer and EEProm (Oshonsoft)

DogFlu66

Member

DS1624 – Digital Thermometer and EEPROM


The DS1624 is a digital thermometer and memory device from Maxim Integrated that combines two key functions:
  1. Temperature sensing: It measures temperature digitally with a resolution of 0.03125°C, and provides output in a 2-byte format (MSB and LSB). It supports both continuous temperature conversions and one-shot mode for power-sensitive applications.
  2. EEPROM memory: It includes 256 bytes of non-volatile EEPROM, which can be used to store user data such as configuration settings, calibration parameters, or logging data. The EEPROM retains its contents even when power is removed.
The DS1624 communicates via a 2-wire I²C-compatible interface, which allows easy integration with microcontrollers. Each device on the I²C bus can be uniquely addressed via configurable address pins.



DS1624 Library for PIC18 (Oshonsoft BASIC)
This library provides easy-to-use functions to interface with the DS1624 using I²C communication. It is written in Oshonsoft PIC18 Basic and requires the I2CLib.bas file for basic I²C operations.

Library Functions


DS1624_Config_Temp(mode As Bit) As Byte​

Configures the temperature measurement mode:
  • mode = 0 → Continuous conversion mode (automatic, periodic measurements)
  • mode = 1 → One-shot mode (conversion starts only when commanded)
The function writes the configuration to the internal register of the DS1624.

DS1624_Init_Temp() As Byte​

Initiates a temperature conversion. This function is only required when the device is in one-shot mode. It sends the Start Convert T (0xEE) command to the DS1624.

DS1624_Rd_Temp() As Single​

Reads and returns the current temperature in degrees Celsius (Single precision). The temperature is read in two bytes:
  • MSB: Whole degrees
  • LSB: Fractional part (using 5 most significant bits)
The result is calculated as:
Temperature = MSB + 0.03125 × (LSB >> 3)

DS1624_Wr_E2PROM(address As Byte, value As Byte) As Byte​

Writes a single byte (value) to the specified EEPROM address (0 to 255). Internally, it uses the Write EEPROM (0x17) command followed by the address and data.
After writing, the function waits 5 milliseconds for the EEPROM to complete the write cycle.

DS1624_Rd_E2PROM(address As Byte) As Byte​

Reads a byte from the EEPROM at the specified address. It uses the Read EEPROM (0x17) command and returns the stored data byte.

Test DS1624.jpg
 

Attachments

Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top