Using Linx RF modules ?


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Can we see you code so we can tell you where the problem is?
    Did you code for the data slicer?

    http://www.picbasic.co.uk/forum/showthread.php?t=11589

    In the meantime look at the tips and tricks section here.
    http://davehouston.net/
    I will post the code, it's on another laptop I'll fire back up in a little while and post from there. Not much code to it though, just a simple routine to test and be a starting point to learn.

    Did I code for the data slicer ? Uh, no, I've made data slicers before from TL 085 op amps before but I don't know about coding for them. I did notice in the data sheet that the RX module has a slicer.

    Thanks for the links, not to get OT but I really like your site and bookmarked it ! I packed my last home with X10 stuff, touchscreens controlling TV's and whole house audio through a Smartlinc controller with IR ports, the Smart rocker switches with the vertical row of green LED's, and on and on. I miss that setup, I just have some basic X10 control here now, I still have the controller though.

    One more OT thing I thought you might be interested in, I also have the X10 remote pan and tilt modules and the range on the handheld remotes were awful, I added a variable cap in series with a telescoping antenna installed in the remote and the range more than quadrupled and they look factory. They were almost totally useless to me before I added the antennas.

    I'll go back to reading your links on this topic though and post back later.THANKS again.

    Hi Joe, I think I did try T2400 and still garbled, I'll check it again. BTW: your tachometer program is working great for me, only problem is once you go over ~1000 RPM I have to divide the readout by half but that's not a problem since I don't need to run the machine over 1000 RPM anyway. I checked it with a handheld laser tach.

    Man, I keep getting off my own topic here,

    Thanks guys, later.

  2. #2
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Okay, I did have some success. I had both modules on the same breadboard, I moved the TX module to it's own breadboard and instantly started receiving text properly on the RX module and feeding the data out of the RX into hyperterminal.

    This was without an antenna on the RX module, with the antenna I'm getting all sorts of characters which must be "static" of course. So I guess that I need to have a PIC connected to the data out of the RX and programmed to only respond to the string my TX is sending right ?

    Such as: Serin DATAIN_pin,N2400,["THIS IS A TEST"] ???

    Here's my extremely simple "code" ...

    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 8/16/2009                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    '12F675
    _CONFIG
    @ DEVICE PIC12F675, XT_OSC 
    _NOCLKOUT  
    _WDT_ON 
    _PWRTE_ON
    _MCLRE_OFF
    _BODEN_ON
    DEFINE OSC 4
    INCLUDE "modedefs.bas"
    TX_Pin VAR GPIO.1    'To DB9 TX pin 3
    RX_Pin VAR GPIO.0    'To DB9 RX pin 2
    
    TRISIO.0 = 1         'Set GPIO.0 to input.
    TRISIO.1 = 0         'Set GPIO.1 to output     
    
    ANSEL = 0            'disable ADCs
    CMCON = 7            'disable comparator
    
    
    Tx_Pin = 0           'inverted mode idle state
    
    
    Pause 100            'OSC settle time... 
    
    loop:
        IF GPIO.2=1 THEN
    	SerOut tx_pin,N2400,["THIS IS A TEST",13,10]
    	Pause 500
    	ELSE 
        GOTO LOOP
    	ENDIF
        Pause 500
        GoTo loop

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sam View Post
    with the antenna I'm getting all sorts of characters which must be "static" of course. So I guess that I need to have a PIC connected to the data out of the RX and programmed to only respond to the string my TX is sending right ?
    Here's a picture to illustrate the problem.

    The data out line of a receiver (i.e. output of the data-slicer) is shown in the bottom trace - the analog input to the data-slicer is shown in the top trace. All of the RS232 methods (HserIn, HserIn2, SerIn, SerIn2) wait for a start bit and then sample at the midpoint of each bit period. They will interpret the random noise on the left as data bytes - the output will be a series of random bytes.

    From the datasheet for your receiver
    • The receiver’s output may appear to switch randomly in the absence of a transmitter. This is a result of the receiver sensitivity being below the noise floor of the board. This noise can be handled in software by implementing a noise-tolerant protocol...
    What is the data you want to send? How long are the messages?
    Last edited by dhouston; - 22nd August 2009 at 12:41.

  4. #4
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    What is the data you want to send? How long are the messages?
    My first thought was as follows, a PIC and TX module located at a CNC machine,
    when the machine moves to specified locations a button closure would activate the PIC/TX to send a short message such as "Change Tool". And other sensors could initiate messages such as "motor stopped" or "coolant flow", ETC.,ETC. and this would be received and the message displayed on an LCD through a PIC on the receiver end.


    Or, maybe the better way is to have the PIC/TX send a single character such "a" 5 times or so for one button and another like "b" to the RX/PIC and the RX PIC will generate the appropriate sentence to be displayed on the LCD.

    So to answer your question, just short messages or single characters representing different button closures.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sam View Post
    ...PIC and TX module located at a CNC machine...
    Then, at minimum, you will need error detection. How radio-noisy is the environment? What's the distance between transmitter and receiver? Will this be the only CNC transmitter or are there multiple CNC machines where you might deploy this?

    The shorter the message, the better.

    I would use something like the NEC protocol for which I have an example on the page mackrackit referenced earlier. I would send each packet 3-5 times with a 10-20mS interval between them, discarding duplicates and any with errors received. This method allows you to handle other tasks within the main loop.

    If you want to do it purely with RS232, use $FF,$FF,$FF,$FF,$00,$00,$55 as a preamble and have the receiver's PIC WAIT for the $55. The data (but not the preamble) should be manchester encoded. I would also send these packets 3 or more times with the above interval. With this method you will need to use a timeout if you need to handle other tasks. All in all, I consider it problematic for this application.

    If range is not an issue, you might want to consider using the squelch circuit shown in Figure 11 of the Linx datasheet for the receiver. This would eliminate most of the noise (i.e. static) and simplify reception.

    However, the best way to do this would be with an FSK transmitter and an FSK receiver with a Carrier Detect output.

    Out of curiosity, what type of operation? I spent several years in the machine tool industry and most CNC controls either displayed or had serial outputs for this type of data.
    Last edited by dhouston; - 22nd August 2009 at 15:51.

  6. #6
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    There's allot more to this than I realized and while I love to learn new things, especially PICs and all electronics I think maybe I should go with encoder/decoder chips like THESE and then do the PIC LCD from that.

    What do you think about going that route ?

    Range only needs to be 50 to 70 feet at most.

    And it's your site I bookmarked, sorry about that, very interesting site !

    Regarding your question about my CNC setup, it's mostly a hobby setup. I converted a Seig milling machine to CNC and I use Mach3 to control it. I do think there are more outputs from Mach3 I can use but buttons and sensors will suit me fine for now. I do have output functions setup with it to turn the motor and the flood coolant pump on and off per the G-code via an optically isolated relay board I made for it.

    Below is a picture of a pendant I made to do the basic functions of the CNC mill so I almost never have to touch the keyboard and a picture of the drivers and power supply in a PC tower case. The perfboard seen is a 12F675 that toggles the power on off via the OEM momentary push button on the front of the case. This picture was taken before I installed the dual optoisolated relay board in the case, also added a second large fan.

    Thanks for your help
    Attached Images Attached Images   
    Last edited by Sam; - 22nd August 2009 at 17:37.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sam View Post
    ...I think maybe I should go with encoder/decoder chips like THESE and then do the PIC LCD from that.
    I think the Holtek chips are too limiting. However, Bruce Reynolds has posted some code here for receiving/decoding some Holtek codes.

    I'm not familiar with the Mach3 package (and it's been about 25 years since I worked in the industry) but a quick scan of the introduction to its manual indicates it can handle most of what you want. I would study that before choosing a course.

    It also seems you want a remote wireless readout so it may be that you will need to add to the built-in functions. The range you need is not a problem with a good antenna unless there are intervening walls. Most range estimates are line-of-sight and you need to figure about 20% of that for indoor use.

    My preference is still for FSK transmitter/receiver (with Carrier Detect). Carrier detect with the FM signal along with manchester encoding makes for a very robust system and most FSK TX/RX pairs cost less than the AM modules you've chosen.

    I would not do this with a PIC but would use one of the ZBasic chips - probably one of the native versions as it's very easy to create interrupt routines. The ZX328n costs $10, has a free compiler, and includes a serial downloader so you can reprogram it at will. Even if you decide on a PIC, ZBasic is great for developing things quickly which you can then rewrite in PBP.
    Last edited by dhouston; - 22nd August 2009 at 18:23.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sam View Post
    I also have the X10 remote pan and tilt modules and the range on the handheld remotes were awful, I added a variable cap in series with a telescoping antenna installed in the remote and the range more than quadrupled and they look factory. They were almost totally useless to me before I added the antennas.
    The FCC frowns on that. You should not alter the antenna (or anything else) on a transmitter. You can usually achieve the same result by improving the receiver antenna or by adding a wideband preamp between the antenna and receiver. This will improve range without interfering with any hams in the neighborhood.

Similar Threads

  1. RF Modules (Zigbee)
    By Chris Barron in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 4th March 2010, 18:28
  2. Linx RXM-900-HP3 Rf Modules
    By Steve_88 in forum Off Topic
    Replies: 1
    Last Post: - 3rd June 2008, 15:58
  3. RF Transceiver modules help
    By davewanna in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 14:54
  4. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  5. Wireless comms with Linx LR modules
    By telemark in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd July 2006, 01:58

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