Information Technology Reference
In-Depth Information
3 Wireless Temperature Measure Software Design
In order to ensure the credibility of wireless communication, use mold 64 rectifying
code, and request to launch the data twice. Only when mold 64 rectifying code is all
right and two temperature values is homology, think correspondence success.
PT2262/2272 coded communication is carried out by a half-byte mode. The data pack-
age is composed of the header E, 8 BCD code, temperature values and check code.
The correspondence data package format as follows:
E BCD0 BCD1 BCD2 BCD3 BCD4 BCD5 BCD6 BCD7 CRC
Header checksum module 64 requests the sum of 12 half-byte. When the result of 5
low-bits is zero and BCDi=BCDi+4(i=0, 1, 2, 3), think correspondence success, and
update temperature data.
3.1 The Design of Temperature Measurement Transmitting Program
Interrupt service flow chart is shown in Fig. 3. After system is initialized, MCU turns on
external device power switch, go into temperature measure process, then repeat trans-
mitting temperature measurement data twice and get into sleep state. In sleep mode
MCU can be waked by timer interrupt. Interrupt once, the interrupt counter plus 1, and
re-enter the sleep mode. When the timer has risen to the setting numbers, then jumps to
the main program start position and turn on external equipments power switch and again
go to measurement temperature and data transmitting progress, again and again.
3.2 The Design of Receiving Temperature Program
Receive program include main program and interruption service sub-program two
parts. Interrupt service program frame diagram such as Fig. 4 show. Receive data with
Interrupt Service
Service Interrupt
Turn on external power
Receive CN
Start A/D, Read CT value
CN > SH?
Y
N
CN=CT+CL
Y
CN < SL?
Transmit CN
N
Alarm
Alarm
Display CN. Print CN
Delay, turn off external power
Interrupt return
Interrupt return
Fig. 4. Interrupt receive flow chart
Fig. 3. Interrupt transmit flow chart
Search WWH ::




Custom Search