• Realizes - en.51rd.net based on the TMP04 PIC monolithic integrated circuit temperature measurement

        Abstract: The digitization temperature sensor may the temperature quantity by the digital pulse signal form output, have the measuring accuracy to be high directly, antijamming ability is strong, the transmitting range is far, periphery interface circuit simple and so on many merits. Simultaneously the digit temperature sensor may also carry on the connection directly with the microprocessor, has facilitated sensor output signal processing greatly. This article take PWM the pattern output’s TMP04 type number character style temperature sensor as an example, introduced realizes several kind of temperature measurement plans by the PCI monolithic integrated circuit, and gives the software design flow.

        Key word: Digital temperature sensor PCI monolithic integrated circuit TMP04 PWM

    1 introduction

    In the majority observation systems, the temperature is the essential examination quantity, the temperature sensor is also observes and controls in the system the very important sensing component. Along with the digitized sensor technology’s unceasing development, presented each type digit temperature sensor. The digit temperature sensor may directly the temperature information digitization form output which examines, compares with the traditional simulation type temperature sensor, has the measuring accuracy to be high, the power loss is low, the stability is good, periphery interface circuit simple characteristic. But monolithic integrated circuit microprocessor more and more richer periphery functional module, more convenient digital temperature sensor output signal processing. The digital temperature sensor main output pattern has PWM, SPI, I2C, SMBus and so on, now the mainstream monolithic integrated circuit nearly supports this connection way, in the article take the PWM output pattern as an example, discussed the PIC monolithic integrated circuit regarding this kind of output pattern temperature measurement plan. PWM pattern output’s digit temperature sensor like TMP03/04, TPM05/06 and so on, after are the temperature information digitizations which obtains the sensing component, undergoes certain output coding, modulates the digital pulse signal single track which the dutyfactor and the temperature are proportional to output. After output signal turning on microprocessor, only need obtain the digital pulse signal the dutyfactor to be possible to obtain the corresponding temperature information by the software operation. But regarding the microprocessor, the input signal dutyfactor computing mode many and varied take the PCI series monolithic integrated circuit as the example, in PIC16, PIC17, PIC18 may by the CCP module capture function, the RB port level fluctuation look-at-me function, the external interrupt function and so on many kinds of methods realize. The following will do separately introduced.

    2 hardware designs

    Because the digital temperature sensor direct output digital pulse signal, does not need the following AD transformation and the temperature compensation, therefore is simple based on the digital temperature sensor’s temperature measurement electric circuit hardware, only needs the monolithic integrated circuit microprocessor and the sensing chip may realize. When turns on the monolithic integrated circuit needs except the individual collecting electrode opening output’s sensing chip on to pull outside in addition the resistance, other sensing chip may with the monolithic integrated circuit direct connected. Selects the PCI series monolithic integrated circuit in this to take the microprocessor, ADI Corporation’s TMP04 digital temperature sensor takes the sensing chip.

    2.1 PIC series monolithic integrated circuit synopsis

    The PIC series monolithic integrated circuit is 8 COMS monolithic integrated circuits which the American micro core (Microchip) the company produces, its interior uses the Harvard bus structure, causes the complete instruction single byte, the monocycle, is advantageous in enhances the CPU execution collection the speed, thus raises monolithic integrated circuit’s running rate. Its command system uses the simplification set of instructions (R1SC) the technology, the addressing system is simple, is advantageous for the procedure the compilation and the debugging. Its rich exterior functional module has provided the extremely convenient connection for the peripheral device, caused many external instrumentation to be possible to carry on the correspondence directly with the microprocessor. This design uses PIC18F458 has biggest 25mA to pull/fills the electric current, 3 external interrupt, 4 timer/counter, 2 capture/comparison/impulse modulation (CCP) the module, SPI and the I2C two kind of working main synchronized serial module (MSSP), the addressable USART module, the high-quality 10 8 channel modulus switch as well as the integrated CAN main line module and so on many kinds of periphery functional module.

        2.2 digital temperature sensor TMP04 synopsis

    TMP04 is a section of low power loss which, the high accuracy, the width dynamic input range PWM pattern output digital temperature sensor ADI Corporation produces. TMP04 is three end monocord component, its overall function diagram as shown in Figure 1, the measurement result by the PWM code type digital pulse signal in the DOUT pin output, output signal’s dutyfactor with measures the temperature to be proportional, its output coding form as well as concrete temperature formula as shown in Figure 2. And, T1 is 10ms generally, does not catch up with 12ms, T2 to change most greatly along with the temperature change, when output different dutyfactor digital pulse signal expresses the different temperature.

    The TMP04 interior includes one by to input the sampling instrument, the simulation summation, the integrator, the comparator, 1 DAC as well as the digital filter constitutes ∑-Δ the mold number switch, as shown in Figure 3. This modulus switch has the resolution to be high, linearity good, anti-aliasing weeping sound and quantizing noise ability strong and so on many merits, is suitable for the digital temperature sensor and so on micro sensing system. As a result of ∑-Δ the mold number switch’s function, the TMP04 biggest power loss does not surpass 6.5mW, the entire journey miss distance only then 0.5℃, the stability is high. Simultaneously the TMP04 dynamic input range is quite big, the precision is also quite high, in - 25℃~125℃ the temperature range the error is only 1.5℃. TMP04 also has one with its structure, function very similar similar products TMP03, the two only difference is the TMP03 output stage uses the collecting electrode open circuit, the output current may reach 5mA, driving force, may actuate the light pair to realize the long-distance temperature measurement, turns on when the monolithic integrated circuit needs in the external connection to pull the resistance, but the TMP04 output stage uses the supplementary MOSFET electric circuit, its power output and the COMS/TTL electric circuit is compatible, may turn on the monolithic integrated circuit directly.

    3 software designs

    May know by the PWM code’s principle, must determine the temperature signal which the PWM digital pulse signal cabin carries, so long as examines the digital pulse signal the dutyfactor then, take the PIC18 series as the example, a monolithic integrated circuit has 9 different ports (2 CCP module port, 4 RB level transformation interrupt port, 3 external interrupt INT port), may determine TMP04 the output temperature, this was the PWM code type temperature digit sensor has provided the quite nimble connection way and the broader application space.

    3.1 realize by the CCP module’s capture function

    The capture/comparison/pulse-duration modulation CCP module is the PIC monolithic integrated circuit unique periphery functional module, it realizes functions and so on input capture, output comparison and pulse-duration modulation output with TMR1 and the TMR2 coordination use. And the input capture pattern uses in surveying pin input signal cycle, frequency, pulse width, the signal arrival time as well as the evanishment time and so on. Unifies the TMP04 output signal the characteristic, may survey TMP04 separately using the CCP module the output signal high level pulse width T1 and low pulse width T2, then figures out the signal indirectly the dutyfactor, thus obtains the TMP04 output temperature information. Detailed program flow diagram as shown in Figure 4.

        3.2 realize by the RB port level fluctuation interrupt

    Is different with other monolithic integrated circuits, PIC monolithic integrated circuit’s RB4-RB7 port has the input level change look-at-me function, when on the RB4-RB7 random pin’s input level changes (by Gao Biandi or by changes lowly high), may cause CPU to interrupt, execution-interruption disposal procedure. Therefore, may input the TMP04 output signal RB4, when inputs RB4 the signal has the jump, using the RB4 level transformation interrupt transfer interrupt handling routine separately to the signal height level’s pulse width carries on the survey, thus figures out the signal indirectly the dutyfactor, obtains the TMP04 output temperature information finally. Program flow diagram as shown in Figure 5.

        3.3 realize by external interrupt INT

    Realizes by external interrupt INT with the design proposal which interrupts by the RB port level fluctuation realizes is similar, is produces by the monolithic integrated circuit response level fluctuation interrupts, again through interrupt service computation height pulse width, thus obtains the temperature information which the TMP04 output signal’s dutyfactor and carries. Therefore realizes by external interrupt INT with realizes the procedure by the RB port level fluctuation interrupt to be similar, is only changes the interrupt source INT0 (INT1, INT2 to be possible) to interrupt, enables INT0 to interrupt enables position INT0IE, judges INT0 to interrupt flag bit INT0IF, because the INT0 input is the RB0 pin, on the example supposes RB0 is the input, and by the INTEDG0 judgment height level then, the attention must start the RB mouth on weakly to pull the function, its overall procedure flow regulation chart similar chart 5.

    4 empirical datum contrast

    Uses the simple electric circuit and the above software routine when the room temperature for 24.1℃, author with three method survey temperature, to obtain a better precision, each kind designed separately has released arranges with C appraises two kind of temperature measurement procedures, its result and mean value as shown in Table 1.

    Table 1 test result and mean value

    Method  Temperature measurement result  Mean value
    Assembly program C procedure
    CCP capture module 23.9 23.9 23.9
    RB level fluctuation interrupt 24.5 24.1 24.3
    INT0 external interrupt 24.4 24.4 24.4

    5 concluding remark

    When design based on PWM pattern output digital temperature sensor’s temperature measurement system, the key is the signal impulse height level pulse width survey which outputs to the sensor. Because the survey pulse width is (low level) the period counting realizes by the timer in the high level, therefore monolithic integrated circuit’s instruction cycle the immediate influence to the survey precision, an instruction cycle shorter precision is higher. But if the instruction cycle is short but the crystal oscillator frequency is high, will introduce the high frequency interference, therefore the crystal oscillator must realize the situation selection according to the system. In addition must pay attention to the PIC monolithic integrated circuit timer pre-frequency division compared to the hypothesis, should, in the guarantee survey sensor signal pulse width will enter will not have in the overflow situation to cause the frequency division to be smaller than, like this will be advantageous to the enhancement measuring accuracy.

    Share/Save/Bookmark

    Thursday, September 4th, 2008 at 11:16
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3