Git Product home page Git Product logo

digital-thermometer's Introduction

Digital-Thermometer

A digital thermometer implemented with the DS18B20 programmable 1-wire digital thermometer and the PIC18F4550 MCU.

DS18B20.c

Initialization of DS18B20 (DS18B20_init):

Configures RA0 as an output and sends a reset signal to the DS18B20 sensor. Configures RA0 as an input and checks for the DS18B20 response. Prints messages based on the success or failure of the DS18B20 reset.

DS18B20 Reset Function (DS18B20_reset):

Configures RA0 as an output and sends a reset signal to the DS18B20 sensor. Configures RA0 as an input and checks for the DS18B20 response.

DS18B20 Write Function (DS18B20_Write):

Writes a byte of data to the DS18B20 sensor. Uses bit manipulation to send each bit of the data byte to the sensor. Delays for 90 microseconds after setting RA0 high or low for each bit.

DS18B20 Read Function (DS18B20_Read):

Reads a byte of data from the DS18B20 sensor. Uses bit manipulation to extract each bit of data and store it in an array. Combines the bits to form the byte of data.

NOT WORKING YET

DS18B20 Delay Function (DS18B20_DelayMicroseconds):

Configures Timer0 for a specified delay in microseconds. Uses a 16-bit mode with the internal instruction cycle clock (Fosc/4). Disables the prescaler to achieve precise microsecond delays. Calculates the number of Timer0 overflows needed for the delay. Enables Timer0 interrupts, waits for the delay to complete, and then disables Timer0 interrupts.

Timer0 Interrupt Service Routine (Timer0_ISR):

Clears the Timer0 overflow flag. Increments the flag to indicate the delay is complete.

TODO LIST

  • Fix the Delay Function so it can count in milliseconds accurately. Right now, it works only for the value us=500.
  • Implement the rest of the functions of DS18B20
  • Compile an actual program that can measure temperature :)

digital-thermometer's People

Contributors

niel518 avatar

Stargazers

Alexandros Mylonas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.