RX / TX duo


Closed Thread
Results 1 to 20 of 20

Thread: RX / TX duo

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If you design a product that includes a non certified RF transmitter, and
    sell it, then it needs certification prior to the sale. If you sell an RF
    receiver with it, the receiver will need a declaration of conformity.

    If your product is Part 15 compliant, that just means the end-user won't
    need a license to operate it. Assuming they don't make any modifications
    prior to use.

    Download this: http://www.fcc.gov/oet/info/rules/pa...15-2-16-06.pdf

    Section 15.1 explains what Part 15 is about.

    For hobby projects read section 15.23 on Home-built devices

    It doesn't matter which RF modules you use. The TWS/RWS, Linx modules
    or any others that are not pre-certified. It will require certification first if you
    sell the finished product using them. It doesn't matter if you sell just 1 or
    ten million. Your transmitter still needs to be certified, and you'll need a
    declaration of conformity on the receiver.

    You can build the end product with "pre certified" modules, and antennas so
    you don't need to have it certified again. But you need to have proper labels
    fixed on the finished product.

    For example, if your using a Maxstream 9XSTREAM pre-certified module in your
    product;

    (quote from 9XSTREAM documentation)
    The 9XSTREAM module has been certified by the FCC for integration into OEM
    products without any further certification (as per FCC section 2.1091.)

    Changes or modifications not expressly approved by MaxStream could void
    the user’s authority to operate the equipment.

    In order to fulfill the certification requirements, however, the OEM must
    comply with FCC regulations:

    1. The system integrator must ensure that the external label provided with
    this device is placed on the outside of the final product.

    2. The 9XStream may be used only with Approved Antennas that have been
    tested with this module.
    Note that you may still need a 2nd certification if you use a microcontroller
    in the design. When in doubt, send it to a pre-screening lab like Linx. It's
    worth every penny you spend on making sure whatever you crank out there
    is going to have the okee-doke from the FCC.

    As for range with the TWS-434A/RWS-434 combination, you can normally
    expect between 300-500' depending on your finished circuit design or board
    layout.

    Linx LC series, 300' max normally. Linx LR series, up to 3000' line of sight.

    Range with most any RF modules is going to be determined by your finished
    design, antenna choice, operating environment, and a ton of other factors.

    For simple stuff like remote control on/off type applications, you normally
    don't need to mess with manchester encoding/decoding, but you do need to
    work out some method of synchronizing the transmitter/receiver, and
    validating all data when it's received.

    I can't share code we make money with, but I'll share a small part of what I
    use on simple encoding/decoding type apps with PIC's & inexpensive RF
    modules like the TWS/RWS, and Linx modules.

    Transmitter:
    Code:
    PreAmble CON $A5    ' 10100101 preamble
    Synch    CON "~"    ' 01111110 synch byte
    
    SEROUT2 E_OUT,BAUD,[PreAmble,Synch,Address,DAT_OUT,Address,DAT_OUT,CHK_SUM]
    The PreAmble helps DC balance the data slicer (fancy word for a comparator).
    The synch byte is locked onto by the serin routine indicating the start of the
    address/data payload.

    I mixup my address and data bytes, and send them both twice in the same
    data stream. Address,DAT_OUT,Address,DAT_OUT which makes it very hard
    for noise on the receiver end to duplicate my actual payload like this.

    CHK_SUM is just a single byte. It contains Address + DAT_OUT where all 4
    bytes are simply added together prior to sending a packet.

    It doesn't matter that CHK_SUM overflows when adding them together. It's
    just another simple data validation byte to make sure I get a match when
    duplicate bytes of address & data are added together again on the receiving
    end.

    Partial receiver code:
    Code:
       ' Wait for Synch byte, then get new inbound address and data
        SERIN2 D_IN,BAUD,[WAIT(Synch),ADD_IN1,DAT_IN1,ADD_IN2,DAT_IN2,CHK_SUM]
        
        ' / **** Begin data validation **** /
        
        ' Calculate checksum by adding all 4 address and data bytes together
        CheckSum = (ADD_IN1 + ADD_IN2)
        CheckSum = CheckSum + (DAT_IN1 + DAT_IN2)
        
        ' Test new checksum against one received in CHK_SUM
        IF CheckSum != CHK_SUM THEN MAIN
        
        ' Test address & data bytes for match
        IF (DAT_IN1) != (DAT_IN2) THEN MAIN
        IF (ADD_IN1) != (ADD_IN2) THEN MAIN
        
        ' Test received address against hardware address
        IF ADD_IN1 != ADDRESS THEN MAIN
        
        ' Do something with the data received here
    This is really simple stuff, but still very effective. It's easy to synch up both
    ends of the link. Even with really noisy receivers like the Linx LR series or
    RWS-434.

    The Ruff-Bot project works because it continuously sends the same data. It
    will definitely miss a great deal of packets, but with this particular project, it
    really is a moot point. It's also sending data at 9600 bps which is well above
    the TWS/RWS max data rate is, but it still gets enough packets through to
    do the job it was intended to do.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default But schematic design is OK?

    Thanks for the responses guys. I think I will redo the code with the manchester encoding so I can make my projects much more complicated. I was wondering if I could still stick with the same schematic, though. And also, do you have any sample code to accomplish the manchester? Thanks!

    -Mike

  3. #3
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default Oops...sorry about the last post

    Sorry Bruce, my browser freaked out for a second and I didn't scroll down to see the rest of your post. Thanks for the help!!

    -Mike

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Nothing wrong with your schematic. Same basic design I use. As far as manchester code...roll your own. You wouldn't like what I'm using, kludged up, works for me, but it's ugly.
    JDG

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I rarely use manchester, but here's a simple version you can run with a
    terminal program to see how it works. You can easily change it to work
    with serial comms between two PIC via RF.

    You still want to include a preamble & synch byte before each packet.

    The assembler routine is a slightly modified version of one done by Les
    Johnson a long time ago, and it's very fast.

    This version is for an 18F. Just make the rotate instruction change as shown
    to use it on a 12F or 16F part. You'll want to change banka to bank0 also.
    Code:
    ; Compile with MPASMWIN
    X           VAR BYTE
    Y           VAR BYTE
    BitCount    VAR BYTE banka system ' Bank0 system so we don't need an underscore
    ByteIn      VAR BYTE banka system ' to access BASIC variables from assembler
    ByteOut     VAR BYTE banka system
    Manch       VAR WORD banka system ' Holds manchester encoded word
    Temp        VAR WORD banka system ' Temp var
    CRC         VAR BYTE system
    Enc_Dat     VAR WORD[6]           ' Holds 6 manchester encoded words
        
        GOTO Main   ' Jump over encode/decode routines
        
    ASM  ; Note: For 14-bit core just change Rlcf to Rlf
         ; Manchester encode routine
    _Encode
    	Movlw   8
    	Movwf   BitCount
    E_Repeat
    	Rlcf    ByteIn,F   
    	Btfss   STATUS,C
    	Goto    BitClr     
    BitSet                 
    	Rlcf    Manch,F
    	Rlcf    Manch+1,F
    	bcf     STATUS,C
    	Rlcf    Manch,F
    	Rlcf    Manch+1,F
    	Goto    E_Loop
    BitClr                 
    	Rlcf    Manch,F
    	Rlcf    Manch+1,F
    	bsf     STATUS,C
    	Rlcf    Manch,F
    	Rlcf    Manch+1,F
    E_Loop
    	Decfsz  BitCount,F
    	Goto    E_Repeat
    	Return
    ENDASM
        
    ASM
        ; Manchester decode routine.
    _Decode
    	Movf    Manch+1,W
    	Movwf   Temp+1
    	Movf    Manch,W
    	Movwf   Temp
    	Movlw   8
    	Movwf   BitCount
    Repeat
    	Rlcf    Temp,F       
    	Rlcf    Temp+1,F  
    	Rlcf    ByteOut,F  
    	Rlcf    Temp,F      
    	Rlcf    Temp+1,F   
    	Decfsz  BitCount,F
    	Goto    Repeat
    	Return
    ENDASM
    	
    Main:
        ' Manchester encode ASCII characters "A" to "F"
        Y = 0       ' Start array index pointer at 0
        FOR X = "A" to "F"
         ByteIn = X
         CALL Encode
         Enc_Dat[Y] = Manch
         HSEROUT ["Encoded ",X," = ",IBIN8 X," = ",IBIN16 Enc_Dat[Y],13,10]
         Y = Y + 1  ' Increment array index pointer
        NEXT X
        
        ' Decode & print results
        FOR Y = 0 to 5
         Manch = Enc_Dat[Y]
         CALL Decode
         HSEROUT ["Decoded ",IBIN16 Manch," = ",ByteOut,13,10]
        NEXT Y
        PAUSE 10000
        GOTO Main
        
        END
    Here's the output;

    Encoded A = %01000001 = %0110010101010110
    Encoded B = %01000010 = %0110010101011001
    Encoded C = %01000011 = %0110010101011010
    Encoded D = %01000100 = %0110010101100101
    Encoded E = %01000101 = %0110010101100110
    Encoded F = %01000110 = %0110010101101001
    Decoded %0110010101010110 = A
    Decoded %0110010101011001 = B
    Decoded %0110010101011010 = C
    Decoded %0110010101100101 = D
    Decoded %0110010101100110 = E
    Decoded %0110010101101001 = F

    Manchester does have its advantages, but I rarely use it. A big factor is
    getting the receiver/transmitter in synch.

    Like in my previous post, I would definitely use a preamble followed by a
    synch character. That really makes a big difference.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I was doing some reading awhile back on these various modules using On/Off keying, FSK/ASK, whatever. I can see the modules working fine when only sending small data packets that only end up lasting a few milliseconds (with a good preamble of course). But, from what I've read, it seems that the data slicer will lose it's mind after that especially if the data has a lot of repeating 0's or 1's.
    Correct or wrong?
    JDG

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Long periods of 0's will cause problems.

    Short bursts of information like preamble,synch,address,data,checksum etc
    work just fine. The payload is delivered just after everything is stable and in
    synch. Even a few bytes of data with large numbers of 0's works, but you
    wouldn't want to stuff 50 words in there made up of all 0's.

    If you're transmitting long streams of serial data that can vary from all 0's
    to all 1's, then you might want to look into using manchester.

    Here's one example of how a simple remote control encoder works.
    http://www.linxtechnologies.com/docu...datastruct.pdf
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Replies: 67
    Last Post: - 8th December 2009, 02:27
  2. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13
  3. RX - TX timming
    By ruijc in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th February 2009, 00:06
  4. TX RX Buffer Question
    By shawn in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2005, 01:49
  5. Tx and Rx of Single Pin PIC's
    By Dwayne in forum Code Examples
    Replies: 0
    Last Post: - 26th May 2004, 14:55

Members who have read this thread : 1

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