文档介绍:Experiment 3:
RF munication
Chongqing Institute of Technology
Design of Intelligent Instrument
Outline
◆ Experiment Objectives:
Mastering munication technology and data error correction algorithms
◆ Experiment Contents:
The munication between puters is achieved by using RF technology.
◆ Experiment Type
Design
Outline
◆ Experiment Devices:
PC installed software of VB or VC
USB interface card
PTR2000 munication module
Serial port debugging software
Simulation system for MCS-51 single-chip puter
◆ Experiment Steps
Introduction for PTR2000
Interface circuit between PTR2000 and PC
Interface circuit between PTR2000 and MCU
#include <>
sbit sw1=P0^0; /*定义*/
sbit txen=P2^0;
sbit pwr=P2^1;
sbit cs=P2^2;
int i;
void main(void)
{
cs=0; /*PTR2000设置*/
txen=1;
TMOD=0x20; /*,设置串行口9600波特率,方式3*/
TL1=0xFD; TH1=0xFD
SCON=0xD8; PCON=0x00;
TR1=1;
while (1)
{
if (sw1==0) /*查询按键1的状态*/
{
for (i=0; i<1000; i++) /*延时*/
{ ; }
if (sw1==0) /*再查询按键1的状态*/
{
SBUF=0xFF; /*无线发送数据*/
while (TI==0);
TI=0; …
}
}
}
}