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
RECEIVER CODE
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...
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++;}
}
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);}
}
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
Interfacing needed amp 相关文章:
- Wireless in-line switch interfacing lora technology
- doubt in interfacing wireless sensors
- interfacing zigbee module with zigbee-modbus gateway
- Sim 100 GSM Module interfacing
- Variation in the sensitivity of the receiver with interfacing
- RF transceiver nRF2401 interfacing with the PIC micro controller 16f877A
