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 communication

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



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

RF communication
PostPosted: Thu Sep 10, 2009 2:25 am     Reply with quote

Hi

I buy this items for try make a little project:
http://www.hobbyengineering.com/CatRFSCODE.html

but if I have one PIC to Transmitter and other for Receiver how I can communicate? on datasheet tell "data" :S

with I simple printf ("Hello Word"); on transmitter I will see on Receiver? or because on datasheet tell communication "data" printf don't work?

kind regards
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Sep 10, 2009 6:49 am     Reply with quote

You can try. I see, that all datasheet circuits are using Holtek enocder/decoder chips rather than UART communication.

There are basically two issues:
- The RF chips are intended for a near 50 % duty cycle baseband signal (Holtek is using 33%/66%), but not for 10-90% with UART
- A synchronisation of the data stream at send start is required

Ideally, you would use manchester encoding, which provides a perfect 50 % duty cycle modulation, and in addition a preamble for initial synchronisation

I've seen sugestions to send a manchester-like modulation with a hardware UART, stretching 8 bits to two UART frames. But synchronisation on receive can't be perfect with this method, particularly when a hardware UART is used.

I would opt for software manchester encoding and decoding.
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

PostPosted: Thu Sep 10, 2009 10:41 am     Reply with quote

Hi

Is easy make this Manchester encoding and decoding?

If is not easy, some one recommend other hardware RF for I buy? Where (for shipping to Portugal)?

kind regards
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 8:29 pm     Reply with quote

Hi

I return to this project, but without success Crying or Very sad

module RX: http://www.hobbyengineering.com/specs/WENSHING-RWS3716C.pdf
module TX: http://www.hobbyengineering.com/specs/WENSHING-TWSBS3.pdf

Today I try communicate between 2 PICs, the connection stay direct between PIC and module.

But it don't work...

My example program:

On RX PIC:
Code:

#include <18F252.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,BROWNOUT,STVREN
#use delay(clock=20000000)
#use rs232(baud=2400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#build(reset=0x200)
#build(interrupt=0x208)

#org 0x0000,0x01ff
void bootloader() {
#asm
  nop
#endasm
} // Reserve space for the bootloader

#int_rda
void rda_isr(void)
{
char c;

printf("char: %c",getc());
}


void main()
{
   enable_interrupts(GLOBAL);
   enable_interrupts(INT_RDA);   

while (TRUE)
{

}

}


On TX PIC:
Code:

#include <18F252.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,BROWNOUT,STVREN
#use delay(clock=20000000)
#use rs232(baud=2400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#build(reset=0x200)
#build(interrupt=0x208)

#org 0x0000,0x01ff
void bootloader() {
#asm
  nop
#endasm
} // Reserve space for the bootloader

void main()
{

while (TRUE)
  {
   printf("a");
   delay_ms(1000);
   printf("b");
   delay_ms(1000);
  }
}

Someone can help me solve this problem?

Best regards.
Steve H
Guest







PostPosted: Fri Feb 26, 2010 9:22 am     Reply with quote

Divide and conquer

I suggest that you get the RS232 working with a PC on both sides first. Remember that the RS232 to a PC needs to have an inverter from the PIC to the PC (any number of circuits on the web will show you how to do this).

When you have the PC successfully talking to both PICs - then connect both PIC's together with a wire link and get that working.

Then go to your RF link.

This is how I approach every new problem. Instead of making one big giant leap that is bound to confuse and get horribly messed up, it is usually much better to make small steps toward your goal. You will learn things along the way and your resulting design will be much more robust.

HTH - Steve H.
filjoa



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

PostPosted: Fri Feb 26, 2010 8:24 pm     Reply with quote

Hi

I make all this steps... I only work this way ;)

I think which problem stay on breadboard, I think which it don't work fine at high frequencies.

I go try tomorrow.
Guest








PostPosted: Sat Feb 27, 2010 10:04 am     Reply with quote

It sounds like you think the problem is the RF link... Then go debug the RF link by itself.

Hook up a square wave to the data input on the TX - look at the demodulated RX with a scope - does it look right?

Keep working on the RF link by itself until it works correctly...

Then hook up to the PIC.

HTH - Steve H.
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