应用笔记4505

One-Wire Network Controls Remote SPI Peripherals

By:  Michael Petersen

Abstract: To produce the 3-wire SPI™ interface required by a MAX7221 display controller (active-low CS, DIN, and CLK), this 1-Wire® network serially addresses three 1-Wire switches (DS2413). The first switch creates Chip Select directly (active-low CS), the second creates the serial-data line directly (DIN), and the third switch—with the help of three exclusive-OR gates—creates the serial clock (CLK).

A similar version of this article appeared in the September 4, 2008 issue of EDN magazine.

Many 1-Wire-compatible peripherals are available, but for those that lack the 1-Wire capability, the Figure 1 circuit illustrates one way you can implement it. The example shown allows a remote LED display to be controlled by the 1-Wire network via an SPI-compatible display controller.

Figure 1. Three 1-Wire switches (IC1–IC3), three XOR gates (IC4), and the associated components enable a 1-Wire network to control this display via the SPI peripheral IC5.
Figure 1. Three 1-Wire switches (IC1–IC3), three XOR gates (IC4), and the associated components enable a 1-Wire network to control this display via the SPI peripheral IC5.

To produce the 3-wire SPI interface required by a MAX7221 display controller (active-low CS, DIN, and CLK), the 1-Wire network serially addresses three 1-Wire switches (DS2413). The first switch creates Chip Select directly (active-low CS), the second creates the serial-data line directly (DIN), and the third switch—with the help of three exclusive-OR gates—creates the serial clock (CLK).

The edge detector and one-shot (IC4A-C) combine the outputs of IC2 (DATA1 and DATA0) to create a clock signal for the SPI interface. This one-shot clock-generation circuit improves the data rate by requiring only a single 1-Wire transaction per SPI bit, instead of the three transactions (data, clock low, and clock high) that would be required if the IC2 output were used directly as a clock signal.

To transmit data to the SPI inputs, first set the output of IC1 low. Then, transmit the data bits using the following rules:
  • If the current data bit differs from the previous bit, set IC2's DATA1 output accordingly.
  • If the current data bit is the same as the previous bit, toggle IC3's DATA0 output.
The circuit generates a clock pulse each time automatically, and requires only a single 1-Wire command for each data bit sent. When data transmission is complete, send a final 1-Wire command to set the IC1 output high.

This circuit allows a 1-Wire network to control a remote temperature display, but similar techniques can provide an interface to I²C-compatible devices, and to other SPI peripherals such as ADCs and DACs. You can also produce a bi-directional data capability by using additional DS2413 output(s). Note that the SPI data rate is not very fast, and updates to the peripheral are relatively slow, but speed is not an issue for many remote-monitoring applications.

1-Wire is a registered trademark of Maxim Integrated Products, Inc.



相关型号
DS2413 1-Wire、双通道、可编址开关 免费样品  
MAX7221 串行接口、8位、LED显示驱动器 免费样品  


下一步
EE-Mail 订阅EE-Mail,接收关于您感兴趣的新文档的自动通知。
Download 下载,PDF格式 (38kB)  

© Nov 11, 2010, Maxim Integrated Products, Inc.
The content on this webpage is protected by copyright laws of the United States and of foreign countries. For requests to copy this content, contact us.

APP 4505: Nov 11, 2010
应用笔记4505, AN4505, AN 4505, APP4505, Appnote4505, Appnote 4505