[SOLVED] need help with RF remote control from pic to pic using pic16f628a with mikroC code

Status
Not open for further replies.

choura

Member level 1
Joined
Apr 28, 2010
Messages
41
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
algeria
Visit site
Activity points
1,558
hi friends
PLZ help in the second part of this project ( received part) , it uses pic16f628a to receive characters and Lighting leds for every char,

with the attachment file U will get the mikroC code of the part one and general circuit in proteus

if can someone help me with second part to run the circuit correctly, i was trying to do it but i failed.

Q: can i remove the oscillator crystal for two pic's
waiting for reply

thank you before
 

Attachments

  • remote control.rar
    37.8 KB · Views: 126

please friends really I need help for this project. I was trying many examples but nothing running correctly except the part one .
 

I just send characters F, B, R, L, and S using UART mode.

thankyou for your reply sir

- - - Updated - - -

also i'm using pic16f628a in transmitter part and the same pic in the receiver part
 

I need just help in second part of the circuit ( programming of pic16f628a) ; this circuit is remote control based on UART mode to send "F, B, R, L, and S" from pic16f628a to pic16f628a this is the ferst part programming which works correctly with transmitter part but I know it has some errors

transmitter code

Code:
void main() {
TRISA = 0xFF; //set all pin of port A as an input
PORTA = 0x00;
TRISB = 0x00; //set all pin of port B as an output
PORTB = 0x00;
CMCON = 0x07;
UART1_Init(9600); // initialize UART module
Delay_ms(100);


while (1) {
if (PORTA.F0 == 0) { //if push button is pressed
Delay_ms(20);
if(PORTA.F0 == 0) { //send forword signal
UART1_Write('F');
Delay_ms(500);
}
}
if (PORTA.F1 == 0) { //if push button is pressed
Delay_ms(20);
if(PORTA.F1 == 0) {
UART1_Write('B');
Delay_ms(500);
}
}
if (PORTA.F2 == 0) { //if push button is pressed
Delay_ms(20);
if(PORTA.F2 == 0) {
UART1_Write('R');
Delay_ms(500);
}
}
if (PORTA.F3 == 0) { //if push button is pressed
Delay_ms(20);
if(PORTA.F3 == 0) {
UART1_Write('L');
Delay_ms(500);
}
}
if (PORTA.F4 == 0) { //if push button is pressed
Delay_ms(20);
if(PORTA.F4 == 0) {
UART1_Write('S');
Delay_ms(500);
}
}


}
}

code of receiver part when I tried to do it with two characters

void main() {
unsigned int receiver;
PORTA = 0x00;
TRISA = 0x00;
PORTB = 0x00;
TRISB = 0xFF; //set all pin of port B as an output
CMCON = 0x07;
UART1_Init(9600); // initialize UART module
Delay_ms(100);

while (1) {
if (UART1_Data_Ready() == 1) { // if data is received
UART1_Read_Text(receiver, "F", 500); // reads text until 'F' is found

; portA.F0 = 1;
Delay_ms(1000);
portA.F0 = 0;
break;

}

}

if (UART1_Data_Ready() == 1) { // if data is received
UART1_Read_Text(receiver, "B", 500); // reads text until 'B' is found

; portA.F1 = 1;
Delay_ms(1000);
portA.F1 = 0;
Break;

}
}

 

It's still not clear what you are trying to do.

Are you saying it works with a direct connection between transmit pin and receive pin but not over the wireless link or that it doesn't work at all?

If it DOES work with direct connection but fails with a wireless link, please tell us if you are using an AM or FM link. Normally you have to do some signal conditioning, it isn't a simple as just sending a single byte and expecting it to arrive correctly.

Brian.
 

my problem with second part; my example program of receiver part doesn't work, that's right I'll use the RF modules 4333.92 MHz, if some one help me with program because I don't have enough experiences with programming language.

thanks friends for replying to me
 

Why dont you just get the code from the mikro web site?
This has been done there repeatedly.
 

Lets establish something first: If you directly connect the two ends with wires, does it work?

I'm trying to work out whether the problem is in the transmit code, receive code or in the 433MHz link. You can't just send data to a TX module and pick it up at the receiver without some extra code but before looking at that, it's important that a direct link works properly.

Brian.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…