温度LTC1392 with PIC16C84单片机
Introduction.
The Linear Technology LTC1392 is an inexpensive 10-bit A/D converter with the added capability of measuring the temperature of the IC and the value of the nominal +5 V supply. This makes it ideal in monitoring the health of the environment in any electronic equipment.
The low power dissipation also makes it an ideal IC for remote data logging using battery power. The quiescent current when idle is typically 0.2 uA. While performing a conversion the current drain rises to nominally 350 uA.
The device is available from DigiKey (LTC1392CN8-ND) for $7.50 in single unit quantities. A data sheet in .pdf format may be obtained from Linear Technologies.
In the following discussion, interfacing a Basic Stamp 2 with a single LTC1392 is illustrated. Interfacing the LTC1392 with a PIC is also discussed.
Sequence.
A measurement sequence is started by bringing /CS low which resets the device. Note that as it is the high to low transition, CS must first be at logic one. After bringing /CS low, a minimum delay of 80 usecs is required for a temperature measurement and 10 usecs for all other measurements.
Four configuration bits are then serially transmitted by the processor using the TX_DATA and CLK leads. In transmitting toward the device, the data is first set up on the on the TX_DATA lead and the CLK is then brought momentarily low. The actual capture of the data by the LTC1392 is on the rising edge of the clock.
Note that when the device is not selected (/CS high) and during the time this four bits is being sent by the processor, the devices D_out lead (RX_DATA) is in a high impedance mode.
Upon sending the four configuration bits, the 1392's D_out lead (RX_DATA) comes out of tri-state and the result is serially shifted toward the processor, beginning with a logic zero and then the most significant bit or a 10-bit result. Each data bit is transmitted by the LTC1392 on the falling edge of the clock.
Upon receipt of the 10 bits, the /CS is brought high, ending the measurement sequence.
Actually, I left a little out. The device may be configured such that after receipt of the 10 bit result in most significant bit format, continued clocking will cause the result to again be output in least significant bit format. I do not deal with this capability in this discussion. Actually, I am uncertain I grasp why anyone would want it.
The Command Bits.
After bringing /CS low, a four bit conguration word is sent to the device. Bit b_3, (the most significant bit) is always a logic one and is termed the "start" bit. Bits b_2 and b_1 determine the measurement mode as shown;
Mode b_2 b_1 Measurment
0 0 0 Temperature
1 0 1 V_cc
2 1 0 V_differential (1.0 V Full Scale)
3 1 1 V_differential (0.5 V Full Scale)
Bit b_0 is used to specify whether the least significant bit first sequence is to follow the most significant bit first sequence and mentioned above. Let's just cut through the confusion and set it to a logic 1.
Thus, the configuration word is;
mode = 0x09 | (mode 1);
where the mode is either 0, 1, 2 or 3 as noted in the above table.
Conversions.
Upon receiving the 10 bits of data, the temperature, V_cc or other voltage is calculated.
Temperature.
The range between -130 degrees C and 125.75 degrees C is broken into 1024 discrete bands. Thus,
T_c = (125.75 - (-130)) * band / 1024 - 130.0
or T_c = 256/1024 * band - 130
= band / 4.0 - 130.0
For the Stamp;
T_100 = 100 * T_c = 25 * band - 13000
V_cc.
The range between 2.42 and three times 2.42 is broken into 1024 bands. Thus,
V_cc = (3*2.42 - 2.42) * band / 1024 + 2.42
= (2*2.42) * band / 1024 + 2.42
= 4.84 * band / 1024 + 2.42
For
单片机 51单片机 MCU 单片机视频教程 单片机开发 ARM单片机 AVR单片机 PIC单片机 Atmel stm32 单片机学习 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)