Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 14, 2024, 06:50:48 06:50


Login with username, password and session length


Pages: [1]
Print
Author Topic: RF code help  (Read 10056 times)
0 Members and 1 Guest are viewing this topic.
Wizpic
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1200

Thank You
-Given: 550
-Receive: 409



« on: April 23, 2005, 10:23:41 22:23 »

Has anybody got code sample for the proton plus complier on RF code using a TX/RX pair i got a little project lined up which is hte best way of doing it serial or manchester code ?
 
cheers
 
wizpic
Logged

When you think, "I can't do anymore. I need a break," that is the time to challenge yourself to keep going another five minutes. Those who persevere for even an extra five minutes will win in life..
nimdonia
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 3
-Receive: 1


« Reply #1 on: April 24, 2005, 04:21:33 16:21 »

both works fine.,. but i guess u should go with serial
Logged
ero
Junior Member
**
Offline Offline

Posts: 43

Thank You
-Given: 13
-Receive: 27


« Reply #2 on: April 26, 2005, 07:43:06 07:43 »

As a first advise try to use a pic which having Hardware Usart like 16F628 or 16F877. By the way you can use HSERIN HSEROUT commands which are working very well. I had written two program to establish a communication system between two pics. It is a pity that it was written in PBP but the commands are so similar and you can convert them easily from one to other.
The trick was to use the preambl signal first at the beginning of data package sent by TX before to start real comunication. I got this idea from one TX/RX producer. Anyhow, here, I give you the sample codes;
 
TX Section;
--------------
Serout2 OUTPIN,1646,[REP$AA\5,REP$00\5,REP$FF\5]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
 
As you have seen on the first line I give the preambl signal by giving the following combinations;
$AA=%10101 $00=%00000 $FF=%11111
You have to give at least 5-6 times continuously the same data. It will help to RX section for catching one of them absolutely.
 
RX Section;
------------
SerIn2 INPUTPIN,1646,[WAIT ("ER"),DATAVAR]:TOTAL=TOTAL+1
 
The best speed which I found was 600 baud, especailly if you use 4 MHZ xtal.
You can try faster speeds also.
I put one variable as TOTAL to count how many times I am getting the DATAVAR to see how many times I am catching the serial DATA sent by TX section. I have seen that if I send 6 SEROUT commands (as 6 lines) I was catching 5 of them and sometimes even 6. It shows that the system is working very well.
 
I hope you can do somethings with these sample codes.
 
ERO
« Last Edit: April 26, 2005, 07:49:10 07:49 by ero » Logged
nileshhande
Junior Member
**
Offline Offline

Posts: 70

Thank You
-Given: 23
-Receive: 5


« Reply #3 on: October 22, 2006, 11:37:02 11:37 »

As a first advise try to use a pic which having Hardware Usart like 16F628 or 16F877. By the way you can use HSERIN HSEROUT commands which are working very well. I had written two program to establish a communication system between two pics. It is a pity that it was written in PBP but the commands are so similar and you can convert them easily from one to other.
The trick was to use the preambl signal first at the beginning of data package sent by TX before to start real comunication. I got this idea from one TX/RX producer. Anyhow, here, I give you the sample codes;
 
TX Section;
--------------
Serout2 OUTPIN,1646,[REP$AA\5,REP$00\5,REP$FF\5]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
SerOut2 OUTPIN,1646,[("E"),("R"),DATAVAR]
 
As you have seen on the first line I give the preambl signal by giving the following combinations;
$AA=%10101 $00=%00000 $FF=%11111
You have to give at least 5-6 times continuously the same data. It will help to RX section for catching one of them absolutely.
 
RX Section;
------------
SerIn2 INPUTPIN,1646,[WAIT ("ER"),DATAVAR]:TOTAL=TOTAL+1
 
The best speed which I found was 600 baud, especailly if you use 4 MHZ xtal.
You can try faster speeds also.
I put one variable as TOTAL to count how many times I am getting the DATAVAR to see how many times I am catching the serial DATA sent by TX section. I have seen that if I send 6 SEROUT commands (as 6 lines) I was catching 5 of them and sometimes even 6. It shows that the system is working very well.
 
I hope you can do somethings with these sample codes.
 
ERO

hi,
your code works exellent .. i tried to latch and momentry some relays...latch working exellent but momentry not working ...could you please explain some example ..how to ..i already posted twice regarding  momenty funcion (RF Code).but i havnt got any reply..  plz help me out ..
Thanking you

Regards
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC