1-wire Lab

For this lab you will implement a simple 1-wire interface. I will provide you with a single 1-wire device (a temperature sensor). Connect a DS18B20 temperature sensor to the Z8 encore and write a program to read the ROM serial number and temperature from it. Follow the program outline in Application Note 126 (see references below). You will only need to implement standard speed 1-wire communications. Pay particular attention to getting the delay function implemented accurately (what is the minimum and maximum delay that you need?). Think about several ways you can verify your time delay is correct. Choose some way to display the temperature, either using the LED matrix display or use printf to send output to the serial port.

References:

Answer the following questions:

  • How did you connect your 1-wire device? Provide a simple schematic (ASCII art is good) for your 1-wire circuit showing how to connect it to the Z8 development kit.
  • There are many ways to implement delays. Which ways did you try and find that they didn't work well?
  • How did you verify your delay function(s).
  • What is the serial number of your temperature sensor?
  • Explain how you were able to debug your program without interfering with the 1-wire timing.