View previous topic :: View next topic |
Author |
Message |
filjoa
Joined: 04 May 2008 Posts: 260
|
RF communication |
Posted: Thu Sep 10, 2009 2:25 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Sep 10, 2009 6:49 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Thu Sep 10, 2009 10:41 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Thu Feb 25, 2010 8:29 pm |
|
|
Hi
I return to this project, but without success
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. |
|
![](templates/subSilver/images/spacer.gif) |
Steve H Guest
|
|
Posted: Fri Feb 26, 2010 9:22 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Fri Feb 26, 2010 8:24 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Sat Feb 27, 2010 10:04 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|