How use RF-tx-315 and RF-Rx-315

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

How use RF-tx-315 and RF-Rx-315

Postby wftan » Fri Jan 28, 2011 11:56 am

Hi,

May i ask, now i need design 2 circuit , 1 is transmitter and another is receiver.

i used RF-TX-315 and RF-RX-315. when button turn on at tx, LED ,buzzer and USART send address. Rx receive match address and will make LED blinking. Is it my codeword wrong?
Why it cannot function??? i use PIC18F452.

Below is my microc codeword:
For transmitter:
CODE: SELECT_ALL_CODE
unsigned short i;
 void main() {
  PORTB = 0;
  TRISB = 0x20;
  PORTC = 0;                 // Initialize PORTC
  TRISC = 0;                 // Configure PORTC as output
  PORTD = 0;
  TRISD = 0;

  USART_init(10000);                     // initialize USART module
                                          //  (8 bit, 10000 baud rate, no parity bit...)

    while(1)

if (Button(&PORTB,5,1,0) )
  {

   PORTD = 0x50;         // LED and Buzzer turn on


  //if (USART_Data_Ready())
  //{            // if data is received
       i = 0x40;
       USART_Write(i);                    // send data via USART
    //   }

      }
  else
   {

    PORTD = 0x00;
    Delay_ms(1000);
   }
   }


For receiver:
CODE: SELECT_ALL_CODE
unsigned short i==0x00;


void main() {
PORTC = 0;                 // Initialize PORTC
TRISC = 0x80;                 // Configure PORTC as output
PORTD = 0;
TRISD = 0;

Usart_Init(10000);

if (Usart_Data_Ready()) {   // If data is received
      i = Usart_Read();        // Read the received data
   }

   if(i==0x40) {

   Delay_ms(1000);
    PORTD = ~PORTD;         // toggle PORTD
  }
      else
{
PORTD = 0x00;
}
}


Thanks for ur help~~
wftan
Freshie
 
Posts: 7
Joined: Mon Oct 18, 2010 9:18 pm

Re: How use RF-tx-315 and RF-Rx-315

Postby ZaM » Mon Feb 07, 2011 5:17 pm

maybe if u use microC compiler, u can seacrh at HELP for tx n rx code..there are, complete with schematic circuit,just need small modification.
ZaM
Moderator
 
Posts: 78
Joined: Tue Nov 23, 2010 4:16 pm

Re: How use RF-tx-315 and RF-Rx-315

Postby ABSF » Tue Feb 08, 2011 10:12 am

Below is my microc codeword:
For transmitter:


ZaM WROTE:maybe if u use microC compiler, u can seacrh at HELP for tx n rx code..there are, complete with schematic circuit,just need small modification.


He is using MikroC language. Maybe you can help him check why his program doesn't work.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: How use RF-tx-315 and RF-Rx-315

Postby shahrul » Fri Feb 18, 2011 8:58 pm

I not use microC and not really understand the code function. I have sample video for RF here.

What you need to change, like
If push button pressed, uart transmit 0x01. If push button release, uart transmit 0x01.
Then receiver receive that data and response to what you need to be.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: How use RF-tx-315 and RF-Rx-315

Postby yonghui » Sat Feb 19, 2011 9:35 pm

hi,
u can refer to cytron DIY project on RF for the source code.
the RF will need some filtering. because the receiver will keep on receive noises. when the transmitter is not transmitting anything .

regards,
yh
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests

cron