telecontrolli RF module


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120

    Default telecontrolli RF module

    Hello to every picbasic fan,

    I have just return from summer vacations and I am back for more coding...

    I bought from a local shop a set of Tx and Rx 433Mhz RF Modules RT4 and RR3 by telecontrolli.

    See datasheet
    RT4: http://www.telecontrolli.com/pdf/transmitter/rt4.pdf
    RR3:http://www.telecontrolli.com/pdf/receiver/rr3.pdf
    Does anyone have any experience with them???
    I failure to make a link.

    My project
    Tx
    16f627 -4Mhz Ext.osc- rt4 -Antenna wire 17cm

    Rx
    16f627 -4Mhz Ext.osc -rr3 -Antenna wire 17cm -USART RS232


    I use the manchester code from Ioannis(thanks)
    -------------------------------------------------------------------
    'tx
    encoded var word
    mydata var byte
    mydata="T"
    loop:
    gosub encod_r
    serout2 PORTB.0,813,[$55, $55, $AA, encoded.lowbyte,encoded.highbyte]
    pause 1000
    goto loop

    encod_r:
    For i=0 TO 7
    IF mydata.0[i]=0 Then
    encoded.0[i*2]=0
    encoded.0[i*2+1]=1
    Else
    encoded.0[i*2]=1
    encoded.0[i*2+1]=0
    EndIF
    Next i
    Return
    --------------------------------------------------------------

    'rx
    encoded var word
    mydata var byte


    loop:
    SERIN2 reception, 813, [WAIT($AA),encoded.lowbyte,encoded.highbyte]
    gosub decod_r

    serout2 info, 813, [mydata]

    goto loop


    decod_r:
    For i=0 TO 7
    IF encoded.0[i*2]=0 Then
    IF encoded.0[i*2+1]=1 Then
    mydata.0[i]=0
    EndIF
    Else
    mydata.0[i]=1
    EndIF
    Next
    Return
    ------------------------------------------------------------------

    My usart connecting with my PC is working BUT the link is dead.

    Please any help is usefull
    Nikos Geronikolos
    Last edited by ngeronikolos; - 13th August 2009 at 14:56.

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I am not a fan of the technique (oft recommended here) of supposedly training the receiver with a series of $55 and/or $AA. It is difficult to distinguish these alternating bits from the random noise that is always present at the output of a superregenerative receiver. See...for an explanation.

    Also see...for sample code that uses a different technique that really does a better job of what the other technique purports to do - train the receiver by setting its AGC and ATC levels without the need for the receiver to distinguish $55 from noise. For short data transfers, I prefer the NEC protocol given in the first examples. Scroll down to see SerOut2/SerIn2 examples. I only recommend the latter for longer data transfers (and manchester coding is useful here).

    You might also find it worthwhile to actually see the receiver output which you can do by using your soundcard to record it and then a Wave editor to view it. See...
    For short data transfers, I also recommend repeating each transmission 3-5 times. That way you can look for the lengthy start pulse on each pass through your main loop. If you get a pulse that's about half the full width, branch to the routine that receives the data. That way you do not need to block other activity by waitng for the start condition.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default

    More to what Dave noted, my experience with Telecontroli was not the best. So I switched to other brands and finally I made my own using chips by ATMEL and Intersil or Philips.

    Aurel was one that I trusted before.

    Now, as I see it, $55 is %01010101 and $AA is %10101010, so if the PIC catches somewhere in the middle the string it cannot distiguish whether is a 55 or AA or something else.

    May be you can try a different start character instead of $AA.

    Ioannis
    Last edited by Ioannis; - 14th August 2009 at 15:21.

  4. #4
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Thanks both of you for your knownledge,

    I have just made it work BUT with some problems...
    I loose packets...

    In the site of Tx I sent every 3secs a number that increase every loop.
    In the site of the Rx I receiver less than the 50% of the total Tx pakets.

    That is my code:
    ---tx-----------------------------------------------------
    Code:
    include "modedefs.bas"
    @ DEVICE  PIC16F627, HS_OSC
    @ DEVICE pic16F627, WDT_ON ' watchdog timer
    @ DEVICE pic16F627, PWRT_ON ' power-on timer
    @ DEVICE pic16F627, MCLR_OFF ' master clear options (internal)
    @ DEVICE pic16F627, BOD_OFF ' brown-out detect
    @ DEVICE pic16F627, LVP_OFF ' low-voltage programming
    @ DEVICE pic16F627, CPD_OFF ' data memory code Protect
    @ DEVICE pic16F627, PROTECT_OFF ' program code protection
    
    DEFINE  OSC 4                                                                                                                                                                                                                                                               
    CMCON = 7  'Turn off comparators
    VRCON = 0
    INTCON  = 0			    ' Disable interrupts 
    
    encoded	var word
    mydata var byte
    i var BYTE
    mydata=0
    
    loop:
        gosub encod_r
    
            serout2 PORTB.0,813,[$55, $55,$55, $55, $CC, encoded.lowbyte,encoded.highbyte] 
            
        pause 3000
        mydata=mydata+1
    goto loop
    
    '------------------Manchester encoder------------------------------- 
    encod_r:
    For i=0 TO 7
    	IF mydata.0[i]=0 Then
    		encoded.0[i*2]=0
    		encoded.0[i*2+1]=1
    	Else
    		encoded.0[i*2]=1
    		encoded.0[i*2+1]=0
    	EndIF
    Next i
    Return
    '------------------Manchester encoder-------------------------------
    END

    ----rx------------------------------------------------------------------
    Code:
    include "modedefs.bas"
    @ DEVICE  PIC16F627, HS_OSC
    ;@ DEVICE pic16F627, INTRC_OSC_NOCLKOUT ' system clock options 
    @ DEVICE pic16F627, WDT_ON ' watchdog timer
    @ DEVICE pic16F627, PWRT_ON ' power-on timer
    @ DEVICE pic16F627, MCLR_OFF ' master clear options (internal)
    @ DEVICE pic16F627, BOD_OFF ' brown-out detect
    @ DEVICE pic16F627, LVP_OFF ' low-voltage programming
    @ DEVICE pic16F627, CPD_OFF ' data memory code Protect
    @ DEVICE pic16F627, PROTECT_OFF ' program code protection
    
    DEFINE  OSC 4                                                                                                                                                                                                                                                               
    CMCON = 7  'Turn off comparators
    VRCON = 0
    
    ' DEFINE VARIABLES FOR SERIAL TO PC  2400 8-N-1
    DEFINE HSER_RCSTA 90H
    DEFINE HSER_TXSTA 20H
    DEFINE HSER_BAUD 2400
    DEFINE HSER_SPBRG 25
    
    encoded	var word
    mydata	var byte
    i var BYTE
    PAUSE 500
    hserout ["RF Module RT4 and RR3", 13,10];<---------------------------
    
    loop:
        SERIN2 PORTB.0, 813, [WAIT($CC),encoded.lowbyte,encoded.highbyte]
            gosub decod_r
    
        hserout ["mydata = ",DEC mydata, 13,10] ' Display mydata on PC SERIAL RS232
        
    
    goto loop
    
    '------------------Manchester decoder-------------------------------
    decod_r:
    For i=0 TO 7
    	IF encoded.0[i*2]=0 Then
    		IF encoded.0[i*2+1]=1 Then
    			mydata.0[i]=0
    		EndIF
    	Else
    		mydata.0[i]=1
    	EndIF
    Next
    Return
    '------------------Manchester decoder-------------------------------
    END

    and I receiver the following in my PC

    RF Module RT4 and RR3
    mydata = 3
    mydata = 5
    mydata = 11
    mydata = 13
    mydata = 15
    mydata = 16
    mydata = 21

    instead of
    mydata = 1
    mydata = 2
    mydata = 3
    ....

    Please advice
    Regards
    Nikos

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default

    Obviously you loose time with the pause 3000 and the receiver has lost the previous transmission. So it waits for the next valid one.

    Try to send 3-5 timesin a loop the same Serout.... and then wait 3000ms.

    Like this:
    Code:
    loop:
        gosub encod_r
            for i=0 to 4
                serout2 PORTB.0,813,[$55, $55,$55, $55, $CC, encoded.lowbyte,encoded.highbyte] 
                pause 100
            next i
        pause 3000
        mydata=mydata+1
    goto loop
    Receiver may get 1 or more times the data and then you have to filter out. But that is easy to do. First get the transmission right.

    Ioannis

    P.S. It is OK here to use the same variable i.
    Last edited by Ioannis; - 14th August 2009 at 21:44.

Similar Threads

  1. Interfacing 16F88 to RF module
    By scomi85 in forum General
    Replies: 2
    Last Post: - 19th February 2009, 12:52
  2. problem with sending data using RF module
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 51
    Last Post: - 10th April 2008, 17:08
  3. RF Module
    By shahidali55 in forum General
    Replies: 22
    Last Post: - 9th March 2007, 09:00
  4. Rf module
    By tangray in forum Adverts
    Replies: 0
    Last Post: - 7th August 2006, 07:14
  5. Interfacting RF Module
    By rastan in forum General
    Replies: 8
    Last Post: - 10th November 2004, 22: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