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 support@ccsinfo.com

RF pic x pic

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



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

RF pic x pic
PostPosted: Mon Sep 20, 2010 12:36 pm     Reply with quote

hello everybody...

I am doing communication between 02 pics using uart (rs-232).
When they are connected by cables, it works (transmitter and receiver) but when I add RF modules (showed at links below) it doesn't work.

http://www.soldafria.com.br/datasheet/RWS-371-3.pdf (receiver)
http://www.soldafria.com.br/redirect.php?action=url&goto=www.soldafria.com.br%2Floja%2Fdatasheet%2Fmodulos_rf_v1.zip TWS-BS-6(315mhz) (transmitter)

Transmitter:

IN ------- TX
VCC --- 5 Vcc
GND ---Terra
ANT ----Antenna


Receiver

4--5---------- 5 Vcc
6--7--1------ Terra
2 ------------ Rx
8 ------------ Antenna

I am working at 600 bps and at this speed led almost turn on but doesn't.
Everything is mounted over protoboard and transmitter and receiver are 10 cm between each other
Is the antenna important for this test (10 cm from each one)?

I have realized over pin 2 (RX) there is a voltage around 3.18. Is it normal? Should not be around 5.0?

Thank you in advance for any kind of help.

Nina
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

rf pic x pic
PostPosted: Mon Sep 20, 2010 8:34 pm     Reply with quote

It is almost working....

When I touch a piece of wire at pin 2 (RX receiver) and press button (transmitter), so led (at receiver) turn on.
My question is: Do I need install a resistor or capacitor at pin2 (RX receiver)?

Many thank

Nina
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Wed Sep 22, 2010 12:15 pm     Reply with quote

Try using the antenna, try separating the transmitter from the receiver more than 10 cm (more like a couple of feet). You are probably saturating the receivers detection circuit.

Make sure your connections are correct. Post your code for both pics.

Might want to try a different baud rates. 315mhz transmitters are kinda picky about this.
Your voltage at the RX or TX pins can not be measured with a DMM since its going on and off depending on the bits sent/received acting kind of like a PWM. Use an Oscope to check your input and your output from the RF links.

Make sure your voltage regulator is actually putting out 5V and not 4.85 or something. I've had LM7805s that put out 4.85.

Do not put a capacitor on tx or rx. Your data stream will be basically converted to DC and not a bit stream.
_________________
CCS PCM 5.078 & CCS PCH 5.093
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

RF
PostPosted: Wed Sep 29, 2010 4:06 am     Reply with quote

RF link it is working just with the following problem.

I am using two ATX (desktop power supply) to supply Vdc to my RF circuit.

When I use one ATX to supply both circuits (transmitter and receiver) it works (led installed at receiver, turn on)

When I use two ATX so supply transmitter and receiver, circuit stop working.

I have tried with 4 batteries (1.5) but doesn't work.
I tried use ATX to supply receiver and use 4 batteries (1.5) to supply transmitter, but doesn't work
I am using ceramic capacitor at transmitter (TX) and receiver (RX).

I am using two pic16f628 and RS-232 is setup to 300 bps

I would like to have transmitter being supplied by batteries.


what else can I try. please?


Thank you in advanced

nina
vinniewryan



Joined: 29 Jul 2009
Posts: 154
Location: at work

View user's profile Send private message MSN Messenger

PostPosted: Thu Sep 30, 2010 12:20 am     Reply with quote

Do you have an oscilloscope, or can you download a free PC soundcard oscilloscope to monitor the signal on both the transmitters TX pin and the recievers RX pin? Or can you set up an audio amp and connect its input to your circuit to see if you can hear a strong signal at the TX and RX pins of the transmitter and reciever (respectively)?

I've worked with very similar Transmitter/Reciever combos in the past, and these things can be very tricky. Your antennas must be the correct length, you may want to try different baud rates, I had one unit that claimed to work up to 9600 baud, but I could never get it to work past 2400. Also if you're not getting the correct voltage supplied to either unit, your certainly not going to get them to communicate. I've been under by .2 volts and that was enough to make it not work. Another thing I've found to help is to add a delay after each putc(); command.

Code:

if(!input(pin_xx))
{
putc();
delay_ms(5);
}


All of these suggestions together have solved my problems with a similar device, shown here: http://www.narobo.com/articles/rfmodules.html

Test the data pins with a scope or an audio amp to see if you are getting interference or a weak signal and report your findings. Test the voltages to be sure your power supplies aren't causing any problems.
_________________
Vinnie Ryan
assaad



Joined: 09 Dec 2009
Posts: 37

View user's profile Send private message

PostPosted: Thu Sep 30, 2010 2:03 am     Reply with quote

Could you post the data you transmit ? how long it is and about the formate , you should know that most RF modules need preamble and sync before the data .
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

power supply RF
PostPosted: Thu Sep 30, 2010 6:51 am     Reply with quote

Thank you for all informations that you provided.

Follow transmitter and receiver code:

Transmitter
Code:

#include <16F628A.h>
#fuses NOWDT,INTRC_IO, PUT, NOPROTECT, NOBROWNOUT, MCLR, NOLVP, NOCPD
#use delay(internal=4000000)
#use rs232(baud=300, xmit=PIN_B2, rcv=PIN_B1)

#define botao PIN_A1
#define LED PIN_A2

void main() {
output_low(LED);

while(TRUE)
{
if (input(botao) == 0)
{
output_high(LED);
delay_ms(1000);
printf ("1");
output_low(LED);
delay_ms(1000);
printf ("2");
delay_ms(1000);
output_high(LED);
printf ("3");
delay_ms(1000);
output_low(LED);
}

}
}


receiver
Code:

#include <16F628A.h>
#include <stdio.h>
#use delay(clock=4000000)
#fuses INTRC_IO, NOLVP, NOWDT, PUT, BROWNOUT
#use rs232(baud=300, xmit=PIN_B2, rcv=PIN_B1)

char recebe[4] = {""};
int flag, index = 0;
char ligar[4] = {"123"};

#INT_RDA
void recebe_serial()
{
recebe[index]=getc();
if (index == 0)
{
}
if (index == 1)
{
}
if (index == 2)
{
index = 0;
flag = 1;
GOTO FIM;
}

index++;
FIM:;
}

void main() {
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA);
delay_ms(1000);
output_low (PIN_B6);

while(true) {

if (flag == 1)
{
if (stricmp(ligar, recebe)==0)
{
output_high(PIN_B6);
}

flag = 0;
}
}
}

Any suggestion will be welcome.

Many thanks

Nina
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