<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Hack a Day &#187; maxim</title>
	<atom:link href="http://hackaday.com/tag/maxim/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:18:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hackaday.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5560f98f805877b0e332f191cb9e0af3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Hack a Day &#187; maxim</title>
		<link>http://hackaday.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hackaday.com/osd.xml" title="Hack a Day" />
	<atom:link rel='hub' href='http://hackaday.com/?pushpress=hub'/>
		<item>
		<title>Hacking an iButton</title>
		<link>http://hackaday.com/2009/07/09/hacking-an-ibutton/</link>
		<comments>http://hackaday.com/2009/07/09/hacking-an-ibutton/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 01:30:54 +0000</pubDate>
		<dc:creator>Zach Banks</dc:creator>
				<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[security hacks]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[1-wire]]></category>
		<category><![CDATA[atmega]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[ibutton]]></category>
		<category><![CDATA[maxim]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=12583</guid>
		<description><![CDATA[Maxim&#8217;s iButtons, which are small ICs in button-sized disks, are starting to show up in more and more places. They have a range of uses, from temperature loggers to identification, and all use the 1-wire protocol to communicate. Over a furrtek, they hacked an iButton used for buying things from vending machines and created an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=12583&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-12585" title="breadboard1" src="http://hackadaycom.files.wordpress.com/2009/07/breadboard1.jpg" alt="breadboard1" width="450" height="243" /></p>
<p>Maxim&#8217;s <a href="http://www.maxim-ic.com/products/ibutton/">iButtons</a>, which are small ICs in button-sized disks, are starting to show up in more and more places. They have a range of uses, from temperature loggers to identification, and all use the 1-wire protocol to communicate. Over a <a href="http://furrtek.free.fr/index.php?p=crea&amp;a=ibutton&amp;i=2">furrtek</a>, they hacked an iButton used for buying things from vending machines and created an infinite money cheat. They built a small rig based on the ATmega8 to read and write data to the chip. The data was encrypted, so it wasn&#8217;t feasible to put an arbitrary amount on the card. Instead, they used a similar technique to the <a href="http://hackaday.com/2008/08/09/defcon-16-mit-boston-transit-presentation-gagged/">Boston subway hack</a> and restored a previous state to the iButton after something was bought. They also created a hand-held device to backup and restore the contents of a button for portable hacking.</p>
<p>[Thanks furrtek]</p>
<br />Posted in peripherals hacks, security hacks, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/12583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/12583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/12583/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=12583&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/07/09/hacking-an-ibutton/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">zbanks</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/07/breadboard1.jpg" medium="image">
			<media:title type="html">breadboard1</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: 1-Wire temperature sensor (DS1822)</title>
		<link>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/</link>
		<comments>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:35:05 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[home hacks]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[1-wire]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[dallas]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[maxim]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=6706</guid>
		<description><![CDATA[Download: buspirate.v0d.zip Dallas/Maxim&#8217;s 1-Wire protocol is the most requested addition to the Bus Pirate.  We finally got some 1-Wire parts, and today we&#8217;ll demonstrate the DS1822 1-Wire digital thermometer. Grab the datasheet (PDF) and follow along. This post is accompanied by release v.0d of the Bus Pirate firmware for hardware version 0. This includes the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6706&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6812" title="1wire" src="http://hackadaycom.files.wordpress.com/2008/12/1wire.jpg" alt="1wire" width="447" height="207" /></p>
<p><strong>Download:</strong> <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0d.zip">buspirate.v0d.zip</a></p>
<p>Dallas/Maxim&#8217;s <a href="http://en.wikipedia.org/wiki/1-Wire">1-Wire</a> protocol is the most requested addition to the <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">Bus Pirate</a>.  We finally got some 1-Wire parts, and today we&#8217;ll demonstrate the<a href="http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2795"> DS1822 1-Wire digital thermometer</a>. Grab the <a href="http://datasheets.maxim-ic.com/en/ds/DS1822.pdf">datasheet</a> (PDF) and follow along.</p>
<p>This post is accompanied by release v.0d of the Bus Pirate firmware for hardware version 0. This includes the new 1-Wire protocol library, more configuration options, and other improvements.</p>
<p><span id="more-6706"></span><strong><a href="http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2795">DS1822</a> Economy Digital Thermometer (Digikey #<a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=DS1822%2B-ND">DS1822+-ND</a>, $3.87)</strong> We found a footprint in the 1-wire library for <a href="http://www.cadsoft.de/freeware.htm">Eagle</a> on the <a href="http://www.cadsoft.de/cgi-bin/download.pl?page=/home/cadsoft/html_public/download.htm.en&amp;dir=pub/userfiles/libraries">Cadsoft download page</a>.</p>
<p>The 1-Wire protocol uses a single wire for data transfer, and sometimes power. Data is transferred in <a href="http://en.wikipedia.org/wiki/1-Wire#Example_communication_with_a_device">time-sensitive &#8216;slots&#8217;</a> because there isn&#8217;t a separate clock to delineate bit periods.</p>
<p><img class="alignnone size-full wp-image-6755" title="ds1822cct" src="http://hackadaycom.files.wordpress.com/2008/12/ds1822cct.png" alt="ds1822cct" width="452" height="224" /></p>
<table border="0">
<tbody>
<tr>
<td>
<div><strong>Bus Pirate</strong></div>
</td>
<td><strong>DS1822</strong></td>
</tr>
<tr>
<td>
<div><strong>SDA</strong></div>
</td>
<td>DQ</td>
</tr>
<tr>
<td><strong>+5volts</strong></td>
<td>Vdd</td>
</tr>
<tr>
<td>
<div><strong>Ground</strong></div>
</td>
<td>GND</td>
</tr>
</tbody>
</table>
<p>The DS1822 connections are shown in the table. We used the Bus Pirate&#8217;s 5volt supply to power the DS1822, but it also works at 3.3volts. A resistor (R1, ~5K) holds the bus high.</p>
<p>All 1-Wire commands start with a reset procedure, followed by one of five ROM commands.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Command</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>0&#215;33</td>
<td>READ ROM. Read single device address.</td>
</tr>
<tr>
<td>0&#215;55</td>
<td>MATCH ROM. Match device address, followed by 64bit address.</td>
</tr>
<tr>
<td>0xCC</td>
<td>SKIP ROM. Address all devices together.</td>
</tr>
<tr>
<td>0xEC</td>
<td>ALARM SEARCH. Search for alarm condition.</td>
</tr>
<tr>
<td>0xF0</td>
<td>SEARCH ROM. Part of address enumeration procedure.</td>
</tr>
</tbody>
</table>
<p>ROM commands are described on page 10 of the datasheet. All ROM commands are available as macros in the Bus Pirate 1-Wire library, see (0) for a menu. ROM command macros <em>include the 1-Wire bus reset procedure</em>.</p>
<p><strong>Single device</strong></p>
<p><strong><img class="alignnone size-full wp-image-6759" title="singli-4501" src="http://hackadaycom.files.wordpress.com/2008/12/singli-4501.jpg" alt="singli-4501" width="450" height="325" /><br />
</strong></p>
<p>All 1-Wire devices have a unique 64bit (8 byte) address, and some 1-Wire devices are used exclusively to give electronics a unique tracking number. When a single device is connected to a 1-Wire bus, the READ ROM command will extract its address.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;33 r:8 <strong>&lt;&#8211;command</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;33 <strong>&lt;&#8211;READ ROM</strong><br />
xxx 1WIRE BULK READ, 0&#215;08 BYTES:<br />
0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 <strong>&lt;&#8211;ID#</strong><br />
1-WIRE&gt;</p></blockquote>
<p>The command sends a bus reset ({), the READ ROM command (0&#215;33), and reads the 64bit address (r:8, 8 bytes *8bits/byte=64bits).</p>
<p>The first byte (0&#215;22) identifies this as a DS1822 thermometer. The next 6 bytes are unique to this device, and the final byte is a <a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check">CRC</a> of the previous 7 bytes.</p>
<p>Now we can address the device with the MATCH ROM command and send it further instructions.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;55 0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 0&#215;44<br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;55<strong>&lt;&#8211;MATCH ROM command</strong><br />
xxx 1WIRE WRITE: 0&#215;22<strong>&lt;&#8211;start address</strong><br />
xxx 1WIRE WRITE: 0&#215;47<br />
xxx 1WIRE WRITE: 0&#215;45<br />
xxx 1WIRE WRITE: 0&#215;22<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;29<br />
xxx 1WIRE WRITE: 0&#215;44 <strong>&lt;&#8211;start conversion</strong><br />
1-WIRE&gt;</p></blockquote>
<p>First, we send the MATCH ROM command (0&#215;55) and the device address (8 bytes).  Next is the CONVERT T command (0&#215;44, datasheet page 11) that starts the temperature conversion.</p>
<p>A second command sequence retrieves the temperature reading from the DS1822.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;55 0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 0xbe r:9<br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;55<br />
xxx 1WIRE WRITE: 0&#215;22<br />
<em>&#8230;long 1-Wire address&#8230;</em><br />
xxx 1WIRE WRITE: 0&#215;29<br />
xxx 1WIRE WRITE: 0xBE <strong>&lt;&#8211;read scratchpad command</strong><br />
xxx 1WIRE BULK READ, 0&#215;09 BYTES:<br />
0&#215;71 0&#215;01 0xFF 0&#215;00 0x7F 0xFF 0x0F 0&#215;10 0xF8<br />
1-WIRE&gt;</p></blockquote>
<p>The READ SCRATCHPAD command (0xBE, datasheet page 11) returns 9 bytes. We only care about the first two bytes, the rest can be decoded according the the table on page 7 of the datasheet. Temperature is calculated according to page 4 of the datasheet: 0&#215;0171 HEX=369 DEC, 369*0.0625=23C  (74F).</p>
<p><strong>Multiple devices</strong></p>
<p><img class="alignnone size-full wp-image-6756" title="multi-450" src="http://hackadaycom.files.wordpress.com/2008/12/multi-450.jpg" alt="multi-450" width="450" height="340" /></p>
<p>When multiple 1-Wire devices share a bus it&#8217;s more difficult to determine all the addresses. The fastest way to find attached devices is with the SEARCH ROM command (0xF0) and a binary branching procedure. The Bus Pirate automates this with macro (240).</p>
<blockquote><p>1-WIRE&gt;(240) <strong>&lt;&#8211;macro 240</strong><br />
xxx 1WIRE ROM COMMAND: SEARCH (0xF0)<br />
Found devices at:<br />
Macro     1-WIRE address<br />
1.0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A <strong>&lt;&#8211;address</strong><br />
*DS1822 Econ Dig Therm <strong>&lt;&#8211;type according to family code</strong><br />
2.0&#215;22 0xD0 0xC7 0x1A 0&#215;00 0&#215;00 0&#215;00 0&#215;01<br />
*DS1822 Econ Dig Therm<br />
3.0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29<br />
*DS1822 Econ Dig Therm<br />
Found 0&#215;03 devices.<br />
The first 10 device IDs are available by MACRO, see (0).<br />
1-WIRE&gt;</p></blockquote>
<p>The SEARCH ROM command shows the devices it found, and the type according to the family code.</p>
<p>We think typing 8 byte 1-Wire addresses is really tedious, so the first 10 device addresses are stored in memory and can be accessed with the macros (1)&#8230;(10). A buffer for up to 50 device addresses can be defined in the 1-Wire library at compile time. Ideally, this data will be stored in a global scratch buffer shared by all modules in a future firmware update.</p>
<blockquote><p>1-WIRE&gt;(0) <strong>&lt;&#8211;show macro list</strong><br />
0.Macro menu<br />
Macro     1-WIRE address <strong>&lt;&#8211;enumerated device addresses</strong><br />
1.0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
*DS1822 Econ Dig Therm<br />
2.0&#215;22 0xD0 0xC7 0x1A 0&#215;00 0&#215;00 0&#215;00 0&#215;01<br />
*DS1822 Econ Dig Therm<br />
3.0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29<br />
*DS1822 Econ Dig Therm<br />
1-WIRE ROM COMMAND MACROs:<strong>&lt;&#8211;normal commands</strong><br />
51.READ ROM (0&#215;33) *for single device bus<br />
85.MATCH ROM (0&#215;55) *followed by 64bit address<br />
204.SKIP ROM (0xCC) *followed by command<br />
236.ALARM SEARCH (0xEC)<br />
240.SEARCH ROM (0xF0)<br />
1-WIRE&gt;</p></blockquote>
<p>The macro menu (0) will also include the device addresses stored in the roster. Now we can just address devices by macro, rather than typing the whole 64bit address every time.</p>
<blockquote><p>1-WIRE&gt;(85) (1) 0&#215;44 <strong>&lt;&#8211;start conversion</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE ROM COMMAND: MATCH (0&#215;55) *follow with 64bit address<br />
xxx 1WIRE ADDRESS MACRO 1: 0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
xxx 1WIRE WRITE: 0&#215;44<br />
1-WIRE&gt;(85) (1) 0xbe r:9 <strong>&lt;&#8211;fetch reading</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE ROM COMMAND: MATCH (0&#215;55) *follow with 64bit address<br />
xxx 1WIRE ADDRESS MACRO 1: 0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
xxx 1WIRE WRITE: 0xBE<br />
xxx 1WIRE BULK READ, 0&#215;09 BYTES:<br />
0&#215;81 0&#215;01 0x4B 0&#215;46 0x7F 0xFF 0x0F 0&#215;10 0&#215;71<br />
1-WIRE&gt;</p></blockquote>
<p>(85) is a shortcut for a bus reset and MATCH ROM command. (1) is the device address macro, and 0&#215;44 is the command to begin a temperature conversion. Retrieving the reading involves the same macros, but substitutes the command to read the device (0xBE) and grabs 9 bytes (r:9). The temperature is 0&#215;0181, or 24C next to the PC fan.</p>
<p><strong>Taking it further</strong></p>
<p>We used the Bus Pirate to give a visual demonstration of the 1-Wire protocol, but the real challenge is integrating it into your own design. Maxim provides <a href="http://www.maxim-ic.com/products/ibutton/software/1wire/wirekit.cfm">example code</a>, Microchip has an <a href="http://ww1.microchip.com/downloads/en/AppNotes/01199a.pdf">app note</a> (PDF), and you can check out the <a href="http://www.microchipc.com/sourcecode/#heater">example code</a> we used.</p>
<p><strong>Firmware download:</strong> <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0d.zip">buspirate.vod.zip</a></p>
<br />Posted in home hacks, parts, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/6706/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6706&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/1wire.jpg" medium="image">
			<media:title type="html">1wire</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/ds1822cct.png" medium="image">
			<media:title type="html">ds1822cct</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/singli-4501.jpg" medium="image">
			<media:title type="html">singli-4501</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/multi-450.jpg" medium="image">
			<media:title type="html">multi-450</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: 133MHz-16.2kHz programmable oscillator (DS1077)</title>
		<link>http://hackaday.com/2008/11/28/parts-133mhz-162khz-programmable-oscillator-ds1077/</link>
		<comments>http://hackaday.com/2008/11/28/parts-133mhz-162khz-programmable-oscillator-ds1077/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 18:39:06 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[chips]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[frequency dividers]]></category>
		<category><![CDATA[ics]]></category>
		<category><![CDATA[interfacing]]></category>
		<category><![CDATA[maxim]]></category>
		<category><![CDATA[oscillator]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=6359</guid>
		<description><![CDATA[The DS1077 is a 5volt, 133MHz to 16kHz programmable clock source. The internal frequency divider is configured over a simple I2C interface, and the chip requires no external parts. Not bad for under $2. We used the Bus Pirate to test this chip before using it in a project. Grab the datasheet (PDF) and follow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6359&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6371" title="cover" src="http://hackadaycom.files.wordpress.com/2008/11/cover.jpg" alt="cover" width="450" height="287" /></p>
<p>The <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3359">DS1077</a> is a 5volt, 133MHz to 16kHz programmable clock source. The internal frequency divider is configured over a simple I2C interface, and the chip requires no external parts. Not bad for under $2. We used <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface">the Bus Pirate</a> to test this chip before using it in a project. Grab the <a href="http://datasheets.maxim-ic.com/en/ds/DS1077.pdf">datasheet</a> (PDF) and follow along.<span id="more-6359"></span></p>
<p><strong><a href="https://shop.maxim-ic.com/storefront/priceavailable.do?Partnumber=DS1077Z-133%2B&amp;event=PartSearch&amp;menuitem=PriceAndAvailability">DS1077</a>, $1.69 direct from Maxim + $10 shipping.</strong></p>
<p>This chip isn&#8217;t available at any major distributors yet, but Maxim has them for under $2/each with a flat $10 shipping charge. This is an 8pin SOIC surface mount chip, so we made a small breakout board for testing.</p>
<p><em>Test circuit</em></p>
<p><img class="alignnone size-full wp-image-6360" title="schematic-450" src="http://hackadaycom.files.wordpress.com/2008/11/schematic-450.png" alt="schematic-450" width="453" height="212" /></p>
<p><em>Pin connections</em></p>
<table style="height:111px;" border="0" width="240">
<tbody>
<tr>
<td><strong>Bus Pirate</strong></td>
<td><strong>DS1077 (pin)<br />
</strong></td>
</tr>
<tr>
<td>SCL</td>
<td>SCL (8)</td>
</tr>
<tr>
<td>SDA</td>
<td>SDA(7)</td>
</tr>
<tr>
<td>AUX</td>
<td>OUT1 (1)</td>
</tr>
<tr>
<td>+5volts</td>
<td>Vcc (3)</td>
</tr>
<tr>
<td>GND</td>
<td>GND, CTRL (4,5,6)</td>
</tr>
</tbody>
</table>
<p>We powered the DS1077 from the Bus Pirate&#8217;s 5volt power supply. Two resistors, R1 and R2, <a href="http://en.wikipedia.org/wiki/Pull-up_resistor">pull-up</a> the I2C bus to 5volts when it&#8217;s not in use. Capacitor C1 is 0.01uF and C2 is 0.1uF, as recommended by the datasheet. Control pins provide some additional functions, but we bypassed them to ground during our test. Output1 is the primary clock signal pin.</p>
<p><em>Interfacing</em></p>
<table border="0">
<tbody>
<tr>
<td><strong>Address</strong></td>
<td><strong>Purpose</strong></td>
</tr>
<tr>
<td>0b10110000</td>
<td>Default base address (0xB0)</td>
</tr>
<tr>
<td>0xB0</td>
<td>Write address</td>
</tr>
<tr>
<td>0xB1</td>
<td>Read address</td>
</tr>
</tbody>
</table>
<p>We put the Bus Pirate into I2C mode (M, options: I2C, 100kHz). The external pull-up resistors hold the bus at 5volts, so it&#8217;s important to leave the on-board 3.3volt pull-up resistors off (default).</p>
<blockquote><p>I2C&gt;{0b10110000} <strong>&lt;&#8211; DS1077 write address</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xB0 GOT ACK: YES <strong>&lt;&#8211; got ACK</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>First, we broadcast the DS1077&#8242;s address and see if it acknowledges. The address of the DS1077 is 1011, plus three programmable bits (000 by default), and the read (1) or write (0) bit. We got an ACK, so we know that the circuit is working and our connections are good.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Address</strong></td>
<td><strong>Bytes</strong></td>
<td><strong>Register</strong></td>
</tr>
<tr>
<td>0&#215;01</td>
<td>2</td>
<td>10 bit clock divider, n+2 (DIV)</td>
</tr>
<tr>
<td>0&#215;02</td>
<td>2</td>
<td>Prescaler, CTRL pin functions. (MUX)</td>
</tr>
<tr>
<td>0x0D</td>
<td>1</td>
<td>Address select, EEPROM write control. (BUS)</td>
</tr>
<tr>
<td>0x3F</td>
<td>0</td>
<td>Save settings to EEPROM (E2)</td>
</tr>
</tbody>
</table>
<p>The DS1077 is controlled by writing values to the locations shown in the table.</p>
<blockquote><p>I2C&gt;{0xb0 0x0d 0b00001000} , <strong>&lt;&#8211;write to BUS register</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xB0 GOT ACK: YES <strong>&lt;&#8211;DS1077 write address</strong><br />
220 I2C WRITE: 0x0D GOT ACK: YES <strong>&lt;&#8211; BUS register</strong><br />
220 I2C WRITE: 0&#215;08 GOT ACK: YES <strong>&lt;&#8211; BUS register setting</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>By default, the DS1077 saves all changes to the EEPROM. We don&#8217;t need this during testing, so we disable it by setting bit 3 (0b1000) of the BUS register (0x0d). The first four bits must be left as 0, the last three bits select the address to accommodate multiple DS1077s on the same I2C bus. See datasheet page 7.</p>
<blockquote><p>I2C&gt;{0xb0 0&#215;02 0b00011000 0b00000000} <strong>&lt;&#8211;set the 16bit MUX value</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xB0 GOT ACK: YES <strong>&lt;&#8211;DS1077 write address</strong><br />
220 I2C WRITE: 0&#215;02 GOT ACK: YES <strong>&lt;&#8211;MUX register </strong><br />
220 I2C WRITE: 0&#215;18 GOT ACK: YES <strong>&lt;&#8211;data byte 1</strong><br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES <strong>&lt;&#8211;data byte 2</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>The MUX register controls the prescalers, CTRL pin functions, and frequency divider.  We disable the prescaler and CTRL pins, and enable the 10bit frequency divider.  The MUX register is explained on page 5 of the datasheet.</p>
<p>Specific frequencies are generated by dividing the 133MHz reference frequency through the prescalers and a 10bit (1025 level) programmable divider.  The clock is divided by the amount specified in the DIV register, <em>plus two</em>. When DIV=0, the output is 133MHz/2=66MHz.</p>
<p><img class="alignnone size-full wp-image-6361" title="graph" src="http://hackadaycom.files.wordpress.com/2008/11/graph.png" alt="graph" width="208" height="251" /></p>
<p>This scheme gives the best frequency resolution in low ranges, and no steps between 133MHz and 66MHz.</p>
<blockquote><p>I2C&gt;{0xb0 1 0b11111111 0b11000000} <strong>&lt;&#8211;DIV=1025</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xB0 GOT ACK: YES <strong>&lt;&#8211;DS1077 write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES <strong>&lt;&#8211; DIV register</strong><br />
220 I2C WRITE: 0xFF GOT ACK: YES <strong>&lt;&#8211; bits 9:2</strong><br />
220 I2C WRITE: 0xC0 GOT ACK: YES <strong>&lt;&#8211; bits 1:0</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;f  <strong>&lt;&#8211;do a frequency count</strong><br />
9xx FREQ COUNT ON AUX: 16128Hz (16kHz) <strong>&lt;&#8211; DS1077 frequency</strong><br />
I2C&gt;</p></blockquote>
<p>We set all the bits in the DIV register to 1 for maximum frequency division. &#8216;F&#8217; measures the frequency on the AUX pin, which is connected to the DS1077 clock output. With DIV=1025, the frequency is about 16kHz.</p>
<blockquote><p>I2C&gt;{0xb0 1 0 0} <strong>&lt;&#8211; DIV=0, 133MHz divide by 2</strong><br />
&#8230;<br />
9xx FREQ COUNT ON AUX: 0Hz <strong>&lt;&#8211;66MHz, too fast to count</strong></p>
<p><strong>&#8212;&#8212;&#8212;&#8212;-<br />
</strong></p>
<p>I2C&gt;{0xb0 1 0 0b10000000} <strong>&lt;&#8211; DIV=2</strong><br />
&#8230;<br />
9xx FREQ COUNT ON AUX: 3339696Hz (33MHz) <strong>&lt;&#8211;133MHz/4</strong></p>
<p><strong>&#8212;&#8212;&#8212;&#8212;-<br />
</strong></p>
<p>I2C&gt;{0xb0 1 0b00000001 0b00000000} <strong>&lt;&#8211;DIV=4</strong><br />
&#8230;<br />
9xx FREQ COUNT ON AUX: 22192384Hz (22MHz) <strong>&lt;&#8211;133MHz/6</strong></p></blockquote>
<p>We can play with the divider and generate a range of frequencies. The output is always equal to the reference frequency (133MHz) divided by DIV+2. The Bus Pirate&#8217;s input pin is only capable of measuring about 50MHz, so the highest speeds don&#8217;t register. A future version of the Bus Pirate should include a gigahertz prescaler for high frequency measurement.</p>
<blockquote><p>I2C&gt;{0xb0 0x3f} <strong>&lt;&#8211;write E2 register</strong></p></blockquote>
<p>Finally, we can write the E2 register (0x3f) to save these setting in the EEPROM. The DS1077 will now return to these settings at power-on.</p>
<p><strong>Conclusion</strong></p>
<p>The DS1077 simplifies complex clock sources by moving a programmable oscillator and frequency divider into a single chip. It isn&#8217;t available from distributors, but you can buy it directly from Maxim. If you need better control of high frequencies, check out the <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3491">DS1085</a> with 10kHz steps from 133MHz to 8kHz. The DS1085L is a 3.3volt, 66MHz version <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=DS1085LZ-25%2B-ND">available at Digikey</a>.</p>
<p><img class="alignnone size-full wp-image-6367" title="bread-450" src="http://hackadaycom.files.wordpress.com/2008/11/bread-450.jpg" alt="bread-450" width="450" height="405" /></p>
<br />Posted in misc hacks, parts  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/6359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/6359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/6359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6359&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/11/28/parts-133mhz-162khz-programmable-oscillator-ds1077/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/cover.jpg" medium="image">
			<media:title type="html">cover</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/schematic-450.png" medium="image">
			<media:title type="html">schematic-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/graph.png" medium="image">
			<media:title type="html">graph</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/bread-450.jpg" medium="image">
			<media:title type="html">bread-450</media:title>
		</media:content>
	</item>
	</channel>
</rss>
