RF Modules


Closed Thread
Results 1 to 40 of 45

Thread: RF Modules

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I mean the transceiver.
    I have a LED connected to BUSY output of the transceiver on both ( RX and TX modules ).
    The RX transceiver blinks the LED everytime the TX sends data. But this doens not mean the PIC shows the correct DATA on LCD ( sometimes no DATA at all ).

    And sometimes when powerup, the RX transceiver does not blink ( pic and LCD working OK ).

    I'm using DEBUG/DEBUGIN instructions to avoid issues with Hserin/Hserout.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    OK then maybe you need more hysteresis to your power up cycle, which is to say the rate the voltage ascends from zero to operating voltage. Many MCU do not like slow power up, which is why PIC has PWRTE in the configs, it allows power to stabilize before PIC boots, or there may be RF running in on the power causing headaches, you did bypass the power leads with .01 µF caps yes? A ferrite bead there wouldn't hurt either.
    And sometimes when powerup, the RX transceiver does not blink ( pic and LCD working OK ).

    I'm using DEBUG/DEBUGIN instructions to avoid issues with Hserin/Hserout.
    Be mindful of the Port Idle state, whether using hserin or debugin, True is supposed to Idle high and Inverted is supposed to idle low. So use the state which agrees with your receiver's requirements.
    Last edited by Archangel; - 17th June 2009 at 20:20.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi Joe,

    I'm using the same power supply for both.

    I'm using a 7805 with 220uF cap and 2 diodes to lower the VCC to the transceivers.

    About the port idle state...good call

    i've set the port pins high at the beginning of the code for both ( TX and RX pics ) but the result is still the same

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Hi Joe,

    I'm using the same power supply for both.

    I'm using a 7805 with 220uF cap and 2 diodes to lower the VCC to the transceivers.

    About the port idle state...good call

    i've set the port pins high at the beginning of the code for both ( TX and RX pics ) but the result is still the same
    Setting them high is not enough, use pullup or pulldown resistors, depending on what state is required.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Hi Joe,

    I've placed 0.1uF caps on each transceiver VDD and GND pins.

    Also placed a resistor on the receiver side as a pullup for the RX pin.

    Still i get intermittent and incomplete data

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Hi Joe,

    I've placed 0.1uF caps on each transceiver VDD and GND pins.

    Also placed a resistor on the receiver side as a pullup for the RX pin.

    Still i get intermittent and incomplete data
    OK, so then you are getting, some data. That's good. Does the receiver still fail to boot sometimes? If so, have you swapped the Tx/Rx modules to see if they both react that way? (SURE Electronics ) Seem like pretty easy to deal with vendors. Just in case there is hardware problems. If all of the above is TRUE, then I think you will need to reevaluate how you are sending data. You may need to add some character pacing scheme and or send data X # of times to insure reception.
    Are you using Tony's code exactly as published here? If not may we see what you ARE using?
    EDIT: I just loaded Tony's code . . . the half that he posted into MCS for examination . . . I hope you ARE using more than that, on account of there is no place in this where data gets loaded or stored . . . so let us see your code, please.
    Last edited by Archangel; - 18th June 2009 at 20:21.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Hi Joe,

    Does the receiver still fail to boot sometimes?
    No, so far so good

    You may need to add some character pacing scheme and or send data X # of times to insure reception.
    Did that...well...sort of...

    Here's the RX code
    Code:
    '****************************************************************
    '*  Name    : RXDemo.BAS                                        *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 01-06-2009                                        *
    '*  Version : 1.0                                               *
    '*  Notes   : Demo for SureElectronics RF modules               *
    '*          : 16F88                                             *
    '****************************************************************
    
        CCP1CON = %00000000         ' Disable CCP
        SSPCON.5 = 0                ' Disable SSP Module
        ANSEL = %00000000           ' Set analog ports to digital mode
        CMCON = %00000111           ' Turn off comparator  
    
    
    TRISA=%00100000
    TRISB=%00000100
       
    '*****************************************************************************
    'DEFINEs
    '*****************************************************************************
    
    DEFINE OSC 4
    
    @ DEVICE PROTECT_OFF
    @ DEVICE CCPMX_OFF
    @ DEVICE DEBUG_OFF
    @ DEVICE WRT_OFF
    @ DEVICE CPD_OFF
    @ DEVICE LVP_OFF
    @ DEVICE BOD_OFF
    @ DEVICE MCLR_OFF
    @ DEVICE PWRT_ON
    @ DEVICE WDT_ON
    @ DEVICE XT_OSC
         
    '*****************************************************************************
    ' DEFINE LCD pins
    
    DEFINE  LCD_DREG        PORTA
    DEFINE  LCD_DBIT            0
    
    DEFINE  LCD_RSREG       PORTB
    DEFINE  LCD_RSBIT           1
    
    DEFINE  LCD_EREG        PORTB
    DEFINE  LCD_EBIT            0
    
    DEFINE  LCD_BITS            4
    
    DEFINE LCD_LINES 4              ' # of Lines on LCD,  1 or 2 (Note: use 2 for 4 lines)
    DEFINE LCD_COMMANDUS 2000       'lcd delay us
    DEFINE LCD_DATAUS 50            ' Data delay time in us
    
    '*****************************************************************************
    'debug defines
    
    INCLUDE "modedefs.bas" 
    DEFINE DEBUG_REG PORTB  
    DEFINE DEBUG_BIT 3
    DEFINE DEBUG_BAUD 19200
    DEFINE DEBUG_MODE 1
    define DEBUGIN_REG PORTB
    define DEBUGIN_BIT 2
    define DEBUGIN_BAUD 19200
    define DEBUGIN_MODE 1
    DEFINE DEBUG_PACING 10000
    
    '*****************************************************************************
    'PINS
     
    adc     var          PORTA.0  '
    a1      var          PORTA.1  '
    lcd1    var          porta.2  '
    lcd2    var          porta.3  '
    freq    var          porta.4  'pin8 of transceiver
    BUT1    var          porta.5  'Button1
    xtal1   var          porta.6  '
    xtal2   var          porta.7  '
    B0      var          portb.0  '
    B1      var          portb.1  '
    RX      var 	     PORTB.2  ' out
    TX      var 	     PORTB.3  ' in
    lcd4    var          portb.4  'Data pin for LCD         
    lcd5    var          portb.5  'Data pin for LCD
    lcd6    var          portb.6  'Data pin for LCD  
    lcd7    var          portb.7  'Data pin for LCD  
    
    '*****************************************************************************
    'variables
    
    maximo   var        WORD	'maximum value detected
    minimo   var        WORD	'minimum value detected
    media    var        WORD	'average
    mediac   var        WORD	'total of records received - average count
    km       var        WORD	'PowerOn counter
    MA       var        WORD	'
    MI       var        WORD	'
    ps4      var        WORD	'
    value    var        WORD	'value received
    medres   var        WORD	'value sum for avg math
    ADDR     var        word
    ra       var        word
    time     var        word
    timex    var        word
    MYDATA   var        word
    
    'contants
    Row1  CON 128 'constant for LCD line1
    Row2  CON 192 'constant for LCD line2
    Row3  CON 148 'comstant for LCD line3
    Row4  CON 212 'constant for LCD line4
    cl    con 254 'constant for LCD clear line
    
    
    clear
    '*****************************************************************************
    
    INCLUDE "lcdbarIN.bas" 
    DEFINE  LCD4X20  1
     
    '***********************************************************
    INIT:
    high tx
    high rx
    pause 400
    lcdout $fe,1,"  RX demo " 
    lcdout $fe,$c0,"     ...        "
    pause 1500
    if but1=1 then
    goto chann
    endif
    
    man:
    lcdout cl,row1," adc ", dec value 
    lcdout cl,row2," media  ", dec media
    
    rec:
    debugin [wait ("ok"),dec MYDATA]     
    lcdout cl,row4, "received - ",dec MYDATA,"   "
    
    goto REC
    
    chann:
    low freq
    pause 50
    while but1=1
    debug $af, $20
    wend
    goto man
    
    '
    end
    and the TX code
    Code:
    '****************************************************************
    '*  Name    : TXDemo.BAS                                        *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 01-06-2009                                        *
    '*  Version : 1.0                                               *
    '*  Notes   : Demo for SureElectronics RF modules               *
    '*          : 16F88                                             *
    '****************************************************************
    
        CCP1CON = %00000000         ' Disable CCP
        SSPCON.5 = 0                ' Disable SSP Module
        CMCON = %00000111           ' Turn off comparator 
    
    TRISA=%00100001
    TRISB=%00000100
       
    '*****************************************************************************
    'DEFINEs
    '*****************************************************************************
     
    @ DEVICE PIC16F88, HS_OSC
    @ DEVICE PIC16F88, MCLR_OFF
    @ DEVICE PIC16F88, PROTECT_OFF
    
    DEFINE OSC 10
    
    @ DEVICE PIC16F88, CPD_OFF
    @ DEVICE PIC16F88, LVP_OFF
    @ DEVICE PIC16F88, BOD_OFF
    @ DEVICE PIC16F88, PWRT_OFF
    @ DEVICE PIC16F88, WDT_OFF
    @ DEVICE PIC16F88, CCPMX_OFF
    
    '*****************************************************************************
    'ADC
    
    DEFINE ADC_BITS 10 ' Set number of bits in result ( 8 or 10 bits )
    DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
    DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
    
    '*****************************************************************************
    
    ANSEL=%00000001 
    ADCON1=%10000000 'no Vref - Right Justify 
    ADCON0=%11000001  
         
    '*****************************************************************************
    ' DEFINE LCD pins
    
    DEFINE  LCD_DREG        PORTB
    DEFINE  LCD_DBIT            4
    
    DEFINE  LCD_RSREG       PORTA
    DEFINE  LCD_RSBIT           3
    
    DEFINE  LCD_EREG        PORTA
    DEFINE  LCD_EBIT            2
    
    DEFINE  LCD_BITS            4
    
    DEFINE LCD_LINES 4              ' # of Lines on LCD,  1 or 2 (Note: use 2 for 4 lines)
    DEFINE LCD_COMMANDUS 2000       'lcd delay us
    DEFINE LCD_DATAUS 50            ' Data delay time in us
    '*****************************************************************************
    'debug defines
    
    INCLUDE "modedefs.bas" 
    DEFINE DEBUG_REG PORTB  
    DEFINE DEBUG_BIT 3
    DEFINE DEBUG_BAUD 19200
    DEFINE DEBUG_MODE 1
    DEFINE DEBUGIN_REG PORTB
    DEFINE DEBUGIN_BIT 2
    DEFINE DEBUGIN_BAUD 19200
    DEFINE DEBUGIN_MODE 1
    DEFINE DEBUG_PACING 10000
    
    '*****************************************************************************
    'PINS
     
    adc     var          PORTA.0  'analog input
    A1      var          PORTA.1  '
    lcd1    var          porta.2  '
    lcd2    var          porta.3  '
    freq    var          porta.4  'pin8 from transceiver
    BUT1    var          porta.5  'But1
    Xtal1   var          porta.6  'Xtal
    Xtal2   var          porta.7  'Xtal
    B0      var          portb.0  '
    B1      var          portb.1  '
    RX      var 	     PORTB.2  ' in
    TX      var 	     PORTB.3  ' out
    lcd3    var          portb.4  'Data pin for LCD         
    lcd4    var          portb.5  'Data pin for LCD
    lcd5    var          portb.6  'Data pin for LCD 
    lcd6    var          portb.7  'Data pin for LCD  
    
    '*****************************************************************************
    'variables
    
    maximo   var        WORD	'maximum value detected
    minimo   var        WORD	'minimum value detected
    media    var        WORD	'average
    mediac   var        WORD	'total of records received - average count
    km       var        WORD	'PowerOn counter
    MA       var        WORD	'
    MI       var        WORD	'
    ME       var        WORD	'
    ps4      var        WORD	'
    value    var        WORD	'value received
    medres   var        WORD	'value sum for avg math
    ADDR     var        word
    ra       var        word
    time     var        word
    timex    var        word
    MYDATA   var        word
    
    'contants
    p1a             con   $10     
    p1b             con   $e20
    ctw             CON   $A0 
    Row1  CON 128 'constant for LCD line1
    Row2  CON 192 'constant for LCD line2
    Row3  CON 148 'comstant for LCD line3
    Row4  CON 212 'constant for LCD line4
    cl    con 254 'constant for LCD clear line
    
    
    clear
    '*****************************************************************************
    
    INCLUDE "lcdbarIN.bas" 
    DEFINE  LCD4X20  1
     
    '***********************************************************
    INIT:
    high rx
    high tx
    pause 400
    lcdout $fe,1,"  TX demo " 
    lcdout $fe,$c0,"     ...        "
    pause 1500
    debug $55
    if but1=1 then
    goto chann
    endif
    
    man:
    high freq        
    me=0
    for ra=0 to 15
    adcin adc,value
    pause 50
    me=me+value
    next ra
    me=me/16
    media=me
    media=(media*/5000)>>2
    lcdout cl,row1," adc ", dec value 
    lcdout cl,row2," media  ", dec media
    
    
    transmit:
    lcdout cl,row4,"transmiting - ",dec value ,"   "
    debug $55,"ok", dec value dig 3, dec value dig 2, dec value dig 1, dec value dig 0
    
    goto man
    
    chann:
    low freq
    pause 50
    while but1=1
    debug $af, $20
    wend
    goto man
    
    end

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. Low latency Wireless RF transceiver modules?
    By mark155 in forum General
    Replies: 0
    Last Post: - 4th March 2010, 05:20
  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. RF Modules at 433.92MHz
    By Ioannis in forum Adverts
    Replies: 2
    Last Post: - 17th October 2006, 12:36

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