微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > Help needed- Interfacing RX433 & TX433 radio pair with P

Help needed- Interfacing RX433 & TX433 radio pair with P

时间:04-08 整理:3721RD 点击:
Hi

Am a newbie to RF wireless communication.
Am interfacing the TX433 & RX433 radio pair with my PIC micro-controller.

I've written simple codes that transmits and receives 4 bit data through UART at 2400 baud. (My code transmits the value of an integer variable and receives this value on an another PIC)...

Please check it out and recommend modifications.

TRANSMITTER CODE
Code:
#INCLUDE<16f877.h>             //IC HEADER FILE 
#USE delay(clock=4000000)     //SETTING CLOCK FREQUENCY 
#FUSES XT,NOWDT,BROWNOUT,NOPROTECT,PUT  //SETTING FUSES

#use rs232(baud=2400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=4) 

void main() 
{ 
int i=0;while(1){	putc(i);	i++;}
}
RECEIVER CODE
Code:
#INCLUDE<16f877.h>             //IC HEADER FILE 
#USE delay(clock=4000000)     //SETTING CLOCK FREQUENCY 
#FUSES XT,NOWDT,BROWNOUT,NOPROTECT,PUT  //SETTING FUSES

#use rs232(baud=2400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=4) 

void main() 
{ 
int i=0;
char ch;while(1){	ch=getc(i);}

}
This is just a simple code to transmit and recive the value of i... The received value is stored in ch. Depending on the value of ch, some action has to be done... will write codes for this later on.

Please go through this code... suggest me suitable modifications and code/algorithm to implement RF communication...

Sending just 4 bytes of data may be very unreliable ..
You should consider a frame consisting of a preamble character, usually it is 10101010b or AAh, followed by the data bytes and a check-sum (x-or of all characters to this point) at the end ..
This ensures that the receiver has to receive the whole frame before "decoding" data and making the right decision on what to do next ..

See -- "Lowest level framing" in this publication:
http://cst.mi.fu-berlin.de/teaching/...munikation.pdf

Rgds,
IanP

上一篇:hfss error
下一篇:最后一页

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top