News

技术资料

Navigate:Home > News > 技术资料 > Details

精确的USB2.0温度传感器仅需要少量的电子元件

Update:2007-12-04 Views:5924

  这个设计理念向我们展现了一个简单、精确和可靠的用USB去测量温度的设计观点。图一为温度传感器的完整电路图。这个传感器的核心是FTDI 公司的USB到串口转换芯片FT232RQ。FT232RQ 除了其本身默认的UART(Universal Asynchronous Receiver / Transmitter) 模式之外,还有一个所谓的位传送模式bit-bang。这个模式使它的I/O总线成为一个用户可以完全控制的双向数据总线。
温度传感器

  温度传感器仅使用了四线SPI接口(Serial Peripheral Interface)的三个引脚,即串行时钟SCK(serial clock),从属选择SS# (slave select),串行数据输入SDI (serial-data-in)。,为了避免传感器可能出现的任何故障,SDI引脚必须接地。FT232扮演了一个串行外设接口的主设备的角色,通过对SS和SCK引脚的置位和清零操作来模拟AD7814协议。从传感器反馈回来的数据在其他的数据总线上重复执行,这个进程和写的进程同时发生。

  


      为了符合usb的规范,在usb逻辑处于暂停的模式下你可以用睡眠信号来关闭传感器的电源。传感设备可以通过USB接收它的信号并且提升电流到大约为20毫安。 在软件方面,你仅仅需要打开机器然后切换芯片进入为传输模式。通过这个操作,你可以通过发送固定的关键字来模拟PC主机到FT232的SPI通信中。软件可以从PC 和FT232的输入口和输出口反馈回一组端口取样的数据组。

      由于FT232芯片出厂时有其的唯一的序号,你可以在一个多芯片模块的环境下找出正确的设备。 因此,你可以把很多的以FT232为基础的传感器植入电脑。 这个设计理念的核心并不局限于测量温度,同样的你可以把它应用到其它数字接口的传感器中。

  为了获得当前温度,你必须写35个固定的字节到端口寄存器. 当ss为低电平的时候,该传感器预计16个时钟脉冲在串行时钟线。时钟频率为1兆赫。在写操作的过程中,设备从传感器读出的数据总取样。 当后台协议结束的时候,你可以从PC取回数据为进一步处理准备。为了从传感器获得的10位字节消耗了相当可观的数据开销(图2)。虚线箭头标志了无需进一步评价的这些字节。
传感器

  我们设计出了两种双层板结构的电路,尺寸分别为18 × 12毫米( 0.7 × 0.47英寸) 7.6 × 30.5毫米( 0.3 × 1.2 英寸)。图三为它们和USB插头A类型的大小的比较。

USB插头

  A USB-to-serial converter forms the heart of an accurate USB temperature sensor.

  This Design Idea presents a simple, accurate, and reliable design to measure temperature using the USB. Figure 1 shows the complete circuit of the temperature-sensor device. The heart of the sensor device is an FT232RQ USB-to-serial converter from FTDI (Future Technology Devices International). In addition to using the FT232 in its default UART mode, the FT232 works in a so-called bit-bang mode (reference 1, reference 2, and reference 3). This mode changes its I/O lines into a bidirectional data bus, which the user can fully control. The connection with the USB takes place in a standard manner, and the back end of the chip interconnects to an AD7814 digital temperature sensor from Analog Devices (Reference 4).

  The temperature sensor uses a four-wire SPI but only three pins: SCK (serial clock), SS# (slave select), and SDO (serial-data out). To avoid any malfunction of the sensor, the SDI (serial-data-in) line must be grounded. The FT232 acts as an SPI master and emulates the protocol for the AD7814 by setting or clearing the appropriate port pins for SS# and SCK. The data from the sensor gets read back together with all the other bus lines. This process occurs simultaneously with the write process.

  To comply with the USB specification, you power down the temperature sensor using the sleep signal while th

e USB logic is in suspend mode. The sensor device receives its power through the USB and draws only about 20 mA. On the software side, you need only to open the device and switch the chip into the bit-bang mode. After that action, you can send the fixed pattern to emulate an SPI master from the host PC to the FT232 (Figure 2). The software returns a data array of the port samples of both the PC and the FT232, whose ports are inputs and outputs.

  Because the FT232 chips come with a unique serial number, you can identify the correct device within a multichip environment. So, you can put more than one FT232-based sensor onto a computer. The core of this Design Idea is not limited to measuring temperature. You can use other sensors with digital interfaces, as well.       To get the current temperature, you must write 35 fixed bytes into the port register. The sensor expects 16 clock pulses on the SCK line while the SS# is low. The clock frequency is 1 MHz. The device samples sensor-read data during the write operation. After the protocol on the back end finishes, you can retrieve the data from the host PC for further processing. To get just 10 bits out of the sensor involves considerable data overhead (Figure 2). The dashed-line arrows mark the bytes, which need no further evaluation.

  This Design Idea realized two sample circuits on a two-layer PCB (printed-circuit board) measuring only 18×12 mm (0.7×0.47 in.) and 7.6×30.5 mm (0.3×1.2 in.). Figure 3 shows them in comparison to the size of a USB Type A plug. 

Applications|Products|Solutions|News|Partners|Supports|Contact
Copyright © 2002-2025Copyright @ 2017 Sumzi Electric Technical Co,.Ltd Of SHENZHEN . All rights reserved.No.11091659 for ICP Registration Purpose in Guangdong