CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RF Module Help

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








RF Module Help
PostPosted: Sun Nov 29, 2009 8:21 am     Reply with quote

I am using the following code for RX

Code:
//Eg1

#include<16F877A.h>
#use delay(clock=20000000)
 #fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=20M)

#define WireTX PIN_C6 // <--------- C 6
#define WireRX PIN_C7
#include<LCD420.C >
#use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)


 
void main()
{
char data;
lcd_init();
delay_ms(100);
output_high(pin_b3);

while(1) {
    if ( kbhit() )
      {
            data = getc();
            printf(lcd_putc,"\f%c",data,data);
            
      }


      }

}



and for TX

Code:
#include <18F2550.h>
//#define __USB_PIC_PERIF__ 1
    #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
    #use delay(clock=20000000)

//#include <usb_cdc.h>

 #define WireTX PIN_C6 // <--------- C 6
#define WireRX PIN_C7
 
#use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)


 



void main()

int a;
// usb_init();
 while (true)
{

    //  if (usb_enumerated())
   //   { 
 
                 putc('A');
            delay_ms(100);
             putc('B');
            delay_ms(100);
             putc('C');
            delay_ms(100);
   //   }
 

}

 
}



The receiver lcd show some other values....


Please help me....



Thanks
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Nov 29, 2009 9:38 am     Reply with quote

There may be a problem with the RF module, but as far as I understand, it's impossible by design to have a clock
frequency of 20 MHz in HSPLL operation mode. In this case, the TX UART frequency is also different from intended
1200 baud. Available frequencies are 16, 24, 32 and 48 MHz.

To get any help with RF module issues, you should at least mention the module type...

P.S.: CPUDIV1 means 48 MHz Clock (96 MHz/2)
anandpv2009



Joined: 26 Jul 2009
Posts: 31

View user's profile Send private message

PostPosted: Sun Nov 29, 2009 10:11 am     Reply with quote

I don't know my RF module type or any other details..
But here is my rf module picture

http://www.vegakitindia.com/products/RF01A315-2.jpg


I bought it from vegakits

http://www.vegakitindia.com/productdetails.asp?ProdID=RF01A315

Quote:
it's impossible by design to have a clock
frequency of 20 MHz in HSPLL operation mode


But pickit2's frequency is 20mhz...
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Nov 29, 2009 12:21 pm     Reply with quote

Quote:
But pickit2's frequency is 20mhz...

You may want to learn the difference between crystal and CPU clock frequency.
Guest








PostPosted: Tue Dec 01, 2009 4:24 pm     Reply with quote

Hi,

From what I can see from the Vega-site, these are very basic RF modules without any built-in protocol. Such radio links can not be treated as a "wire" between the PIC's.

A good tip is sending packets, starting with 1-3 bytes as preamble so the receiver can "sync" to the transmitters bitrate. Also include a checksum so you can discard packets with errors.

If that´s too much work - try more advanced transceivers that come with this kind of protocol already in their own uP.

Good luck

/BdeB
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group