RF Transmitter/Reciver


Closed Thread
Results 1 to 40 of 76

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Code:
    <html>
    <head></head>
    <body><!--StartFragment--><pre><code><font color="#008000"><i>'****************************************************************
    '*  Name    : Reciver.BAS                                       *
    '*  Author  : Fredrick                                          *
    '*  Notice  : Copyright (c) 2008                                *
    '*          : All Rights Reserved                               *
    '*  Date    : 2008-02-13                                        *
    '*  Version : 2008-02-16                                        *
    '*  Notes   : PIC16F872 @ 20 MHz                                *
    '*                                                              *                                                              *
    '*                                                              *
    '****************************************************************
    </i></font>ADCON1 = <font color="#808080">7 </font><font color="#008000"><i>' Alla digitala
    </i></font><font color="#000080">DEFINE </font>OSC <font color="#808080">20
    </font><font color="#000080">DEFINE </font>LCD_COMMANDUS <font color="#808080">3000   </font><font color="#008000"><i>'Set command delay time in us
    </i></font><font color="#000080">DEFINE </font>LCD_DATAUS <font color="#808080">200       </font><font color="#008000"><i>'Set data delay time in us
    </i></font><font color="#000080">DEFINE </font>DEBUG_BAUD <font color="#808080">2400 
    </font><font color="#000080">DEFINE </font>DEBUG_MODE <font color="#808080">0
    </font><font color="#000080">DEFINE </font>DEBUG_REG PORTC
    <font color="#000080">DEFINE </font>DEBUG_BIT <font color="#808080">7   </font><font color="#008000"><i>'PORTC.7 OLIMEX RS232Board
    </i></font><font color="#000080">INCLUDE </font><font color="#FF0000">&quot;modedefs.bas&quot;
    </font>ReciverPIN <font color="#000080">VAR </font>PORTC.<font color="#808080">0
    </font>Check1 <font color="#000080">VAR BYTE
    </font>Check2 <font color="#000080">VAR BYTE
    </font>Counter <font color="#000080">VAR BYTE
    </font>Errors <font color="#000080">VAR WORD
    
    
    CLEAR
    PAUSE </font><font color="#808080">500
    </font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">1
    
    </font>Main:
        <font color="#000080">SERIN </font>ReciverPIN,N2400,<font color="#808080">100</font>,NoSignal,[<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">63519</font>],Counter,Check1,Check2
        
        <font color="#000080">IF </font>Check1 = <font color="#808080">121 </font><font color="#000080">AND </font>Check2 = <font color="#808080">212 </font><font color="#000080">THEN 
            GOSUB </font>LCD
        <font color="#000080">ELSE
           GOSUB </font>NoSignal
        <font color="#000080">ENDIF
            
    GOTO </font>Main
    
    LCD:
        <font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">$80</font>, #Counter, <font color="#FF0000">&quot;    &quot;
        </font><font color="#000080">DEBUG </font>#Counter, <font color="#808080">13</font>,<font color="#808080">10    
        </font>Check1 = <font color="#808080">0  
        </font>Check2 = <font color="#808080">0
    </font><font color="#000080">GOTO </font>Main
    
    NoSignal:
        Errors = Errors + <font color="#808080">1
    
        </font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">$C0</font>, <font color="#FF0000">&quot;ERROR:&quot;</font>,#Errors,<font color="#FF0000">&quot; &quot;</font>,#Check1,<font color="#FF0000">&quot; &quot;</font>,#Check2
        <font color="#000080">DEBUG </font>#Counter, <font color="#FF0000">&quot;ERROR:&quot;</font>,#Errors,<font color="#FF0000">&quot; &quot;</font>,#Check1,<font color="#FF0000">&quot; &quot;</font>,#Check2, <font color="#808080">13</font>,<font color="#808080">10
        </font>Check1 = <font color="#808080">0
        </font>Check2 = <font color="#808080">0 
    </font><font color="#000080">GOTO </font>Main
    <font color="#000080">END 
    </font></code></pre><!--EndFragment--></body>
    </html>

  2. #2
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I can´t get the SERIN timeout to work
    Fredrick, what you are seeing is the receiver "wait" loop is being re-triggered continuously by the noise (as you probably know by now). There is no proper way to get the "wait" command to work with software only.

    I would suggest the following (this is a simple way to create your own squelch circuit):
    1. Set the threshold for an RSSI level equivalent to a good signal (above that which you capture noise only). This would give you a cleaner mark-space signal (need to make sure the comparator is high speed).
    2. Output of comparator is "ANDed" with the RX-DATA output and sent to SERIN.

Similar Threads

  1. Generic RF Receiver
    By dhouston in forum Code Examples
    Replies: 0
    Last Post: - 8th September 2009, 15:35
  2. Interfacing 16F88 to RF module
    By scomi85 in forum General
    Replies: 2
    Last Post: - 19th February 2009, 13:52
  3. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 21:58
  4. RF designs
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2006, 08:50
  5. Interfacting RF Module
    By rastan in forum General
    Replies: 8
    Last Post: - 10th November 2004, 23:27

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts