View previous topic :: View next topic |
Author |
Message |
Iyed
Joined: 27 Mar 2013 Posts: 9
|
RF Modules with pic 16f |
Posted: Sat Mar 30, 2013 7:21 am |
|
|
Hi, I bought two RF modules and it has beeen a very exhausting week since i've been trying to establish a wireless communication between two pics 16f84a I tried with arduino and it worked I used the Virtual Wire library and it's really good but now i'm trying to get this to work on 16f84a so can any one help me get this right or is there at least a library similar to virtual Wire on pic
PS: The emmiter is FS1000A and the receiver is XY-MK-5V |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sat Mar 30, 2013 8:11 am |
|
|
There is no DC restoration in the receiver.
These are best with an NRZ type code, and very poor with TTL RS-232 signals. |
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Sat Mar 30, 2013 11:25 am |
|
|
I didn't understand a thing you said, could you please give me an easier reply.
+++++++++++++++++++
Iyed,
CCS forum is primarily about CCS compiler.
Circuits are discussed, but use http://www.google.com
to learn electronics.
- Forum Moderator
+++++++++++++++++++ |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Sat Mar 30, 2013 10:53 pm |
|
|
There are a number of things out there, both RF as well as IR types that do not handle signals where there is not a continuous stream of 1's and 0's in a format where you don't get either all 1's or all 0's as part of the stream - without "DC restoration" these types of things get "lost" if the signal stays on one state for a period of time. Search for NRZ and you will understand more about what asmboy was saying.
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 |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sun Mar 31, 2013 2:59 am |
|
|
It can be regarded as a software issue.
Try sending 50% duty square wave from TX to RX, over a range of frequencies.
See what happens.
Mike |
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Tue Apr 02, 2013 9:06 am |
|
|
what i need is data transferring as i did with arduino which worked as a charm but i need it to be running on PIC 16f microcontroller , and for the nrz coding i undersand that the problem is software and i need to code my data but how do implement that in a ccs code to make it work ? |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Tue Apr 02, 2013 9:27 am |
|
|
Iyed wrote: | ...and for the nrz coding i undersand that the problem is software and i need to code my data but how do implement that in a ccs code to make it work ? |
In the same way as you'd implement it for any microcontroller where there wasn't a library to do it for you. It is not a CCS problem, but as you say a general software problem. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Tue Apr 02, 2013 10:12 am |
|
|
I'm not trying to understand all this, I only need a working library. If anyone used these modules before, can he demonstrate the code that he used, because I'm starting to think that i bought those for nothing. |
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Apr 02, 2013 10:38 am |
|
|
You've got the wrong idea.
This is a help you forum, not a do it for you one.
Basically:-
1) You write your own code.
2) When (if) you get stuck, you ask for help.
3) Someone here will be willing to help.
We are not going to do coding for you.
Mike |
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Tue Apr 02, 2013 11:03 am |
|
|
Yes i know what kind of forum this is and believe me I've tried a lot of codes. I came here as a last resort what i essentially did was communicating with the two PICs as there is a RX/TX connection (rs232). But there was no data at the receiver. I thought my code would be useless so i did not copy/paste it. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Apr 02, 2013 11:57 am |
|
|
If you've actually got 2 PICs talking to each other using RS232, then you're 99% done.
You now have 2 options
1) Take the 'virtual wire' source code and convert to CCS C code. Fairly easy to do IF you understand the original source and CCS C. Depending on source code, your level of knowledge, etc. it could be as little as a night or maybe a month to cut the new 'driver'.
2) buy 'seamless' TTL-RF transceiver modules. These take TTL level serial data (aka UART data) and send via RF. Two well known units are 'XBEE' and RFDigital. Yes, they cost more BUT work out of the box!
In the 'wireless' communications scene you get what you pay for.XBEE modules are about $20 each require no programming expertise, no 'timing' issues,'up and running' in minutes. You can 'roll your own' (simple LED and phototransistor) for less than a buck but spend hours or days cutting code, perfecting hardware issues, etc.
The choice is up to you..as the designer. Spend $$ up front for parts but no labour and quickly get the product out the door or spend very little in parts but a LOT of man hours.
it's up to you.
As a manufacturer of custom circuits, I chose #2
As a hobbyist I chose #2
hth
jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Apr 02, 2013 12:14 pm |
|
|
Quote: |
I'm not trying to understand all this, I only need a working library.
|
Ahh, you much clearer now.
You only want results, but do not care for the nuisance of details that real understanding brings. I posted a link to a white paper that would help you understand your problem. Your response leaves me cool to any further effort on your behalf.
Unfortunately ( for you) , the people who have been trying to help you , and who might have insights and or code that works, all started out
by seeking the understanding that you dismiss as being unessential.
You want the results, but not the responsibility to understand those results? Say for a grade in a course and to then move on to the next cribbing exercise?
As such, in the real world of design, people with attitudes like yours
are a menace, and a clear and present danger to others if you end up making actual products.
I suspect you are a student, but better you should honestly fail with that attitude and seek some other line of work more suited to your stunning lack of curiosity. good luck with your efforts |
|
|
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Tue Apr 02, 2013 12:55 pm |
|
|
thanks asmboy that's charming but this is a hobby for me and i know for sure that trying to understand every single detail of it will drag me away from my studies so i only try to get things working not meaning that i don't want to get to know how but i prefer not to go deeper in those stuff and undersanding what benefits me , but let me tell you that not people like me who are a shame for our society but it is people like you who refuse to reach hands for the needy ones and regard those with less knowledge as if they were meaningless ,let me tell you that i appruciated your little help at first but it was beyond my abilities to understandd such things that's why i was hoping for a clearer explanation |
|
|
|