Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RF Module with Pic using Manchester Code

Status
Not open for further replies.

Korawy

Member level 3
Joined
Sep 8, 2011
Messages
61
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,776
Hi all,,

im intending to control DC Motors with a wireless communication.
i bought KST_TX01 & KST_RX806 kit which is RF Module working with ~ 433 MHz, I have used two PICs for this, P16F628A recceiver and P18F452A Transmitter.
I tried to make a simple transmitter - receiver program to switch on a LED, But i get NOTHING.
I used Manchester Code library in mikroC as it is easier than calling a Timer.

This is the Transmitter Code:

void main(){
char ADD;
PCON.OSCF = 1;
TRISB.F0=0;
TRISB.F1=1;
TRISB.F2=0;
cmcon=7;
PORTB=0;
Man_Send_Config(&PORTB, 0);
Man_Send_Init(&PORTB);
ADD=0b10101010;
for(;;){
if(PORTB.F1==0){
Man_Send(ADD);
delay_ms(17);
while(PORTB.F1==0){
Delay_ms(200);}}
}}

and This is the Receiver Code:

char Signal, error;
char x;
void main(){
TRISB.F6=1;
TRISB.F1=0;
TRISB.F2=0;
PORTB=0;
x=0;
Man_Receive_Config(&PORTB, 6);
loop1:
Man_Receive_Init(&PORTB);
for(;;){
Signal = Man_receive(error);
if(error != 255){
if(Signal==0b10101010){PORTB.F1=1;}}
if(error==255){x++;}
if(x==200){
x=0;
PORTB.F2=1;
goto loop1;}}}

Just a simple Code to send one Byte, and when the receiver (P18F452) gets it , it powers on a LED.

Is there anything wrong with my Code?

Thanks in advance,,,
 

It is difficult with this type.
Try to transmit with serial communication and receive in other Pic and then give output to led
 
  • Like
Reactions: Korawy

    Korawy

    Points: 2
    Helpful Answer Positive Rating
Thanks aameer,,

I did it using serial communication.. it worked but i have simple problems.

1- when i connect the receiver to 5v it drops to less than 3v, even if i connect only the receiver (without the micro).

2- when i transmit the data, the LED in the other side blinks if i press the button (which transmits the data) more than one time.

I hope i find help,, Thanks
 

connect with PC and check the output in hyper terminal
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top