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 Transmitter and Receiver 315Mhz

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



Joined: 03 Oct 2012
Posts: 242
Location: chennai

View user's profile Send private message

RF Transmitter and Receiver 315Mhz
PostPosted: Wed May 21, 2014 2:26 am     Reply with quote

Hi, I have bought a RF Transmitter and Receiver 315Mhz and two pic18F2520 controller.
CCS Version: v4.114.

Before I use RF transmitter and receiver module, I want to check the communication between two uC using UART.

Hardware Connections:
One uC as master (Transmitter pin PIN C6) is connected to Another uC pin C7.

do i have to connect,
Master PINC7 to Slave PIN C6???

As an example, I want to send a string "Hellow" and to display in the slave uC .

Transmitter code:
Code:
#include "18F2520.h"
#fuses INTRC_IO
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)

void main(void)
{
   while(1)
   {
      puts("HELLOW"); 
      delay_ms(1000);
   }
}


How to receive this text on the receiver section?
jeremiah



Joined: 20 Jul 2010
Posts: 1349

View user's profile Send private message

PostPosted: Wed May 21, 2014 5:59 am     Reply with quote

You only have to connect the other pins if you want full communication both ways. Normally it is a good idea, so I would suggest starting out with both sets of pins connected

In terms of receiving, you should check out the ex_sisr.c file in your examples directory of the PICC install. It shows how to receive using a serial interrupt and circular buffer.
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Wed May 21, 2014 6:02 am     Reply with quote

In general printf() is more useful than puts().
http://www.commfront.com/USB-Serial-Adapters-Converters/USB-TTL-Converter-Adapter.htm
I dont reccomend to test UART using two uCs. Much easier approach is to print/get some characters or string to a PC. Then you can see what is being sent from the uC. Reciever might be inspected by testing the received character. Let say:
Code:

if(received_character == expected_charackter)
led_on();
else
led_off();

_________________
A person who never made a mistake never tried anything new.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Wed May 21, 2014 6:34 am     Reply with quote

Hi,

One other thing. Your success or failure on this project is probably going to be very dependent on *which* Tx/Rx modules you purchased. These can vary all over the map from totally horrible/useless to quite good/robust. Post a link to what you have!

John
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Wed May 21, 2014 12:55 pm     Reply with quote

Don't forget that if you are using a PC for the other end for testing, you need to do the RS-232 level conversion for it to talk to the PC correctly (although I do agree with talking to the PC as a good test).

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
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