RF Modules


Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 40 of 45

Thread: RF Modules

  1. #1
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33

    Default RF Modules

    Hey

    I have 2 wireless RF Transceivers. The datasheet states that the baud rate is 19200 and that it is customizable. It mentions nothing about how to change it.

    What i'm unsure about is if the baud rates I am using for my serout and serin commands need to match the Rf modules baud rate, or does the baud rate setting on the transceivers just control the rate of data from one module to another allowing me to feed in whatever baud rate I like no matter what the modules are set to.

    Cheers

    Tony

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Hey,
    You forgot to tell the make, model, and mileage of the modules
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Hey cheers for the reply.

    Sorry for not posting the data sheet. I thought it was more of a general question assuming most RF module opperate in a semi similier manner. As for the make and model, there pretty much a no name device, I bought them off ebay, model Cy2198TR-a. Have attached the data sheet that came with them.

    Best Regards

    Tony

    http://www.sure-electronics.net/rf,audio/GP-GC010.pdf
    Last edited by tonyfelloni; - 20th October 2008 at 00:58.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That datasheet pretty much blows IMO. Looks to me like a car owners manual...doesn't tell you how to overhaul the engine, just what the car is supposed to do.
    Any other data around for this module?

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tonyfelloni View Post
    I thought it was more of a general question assuming most RF module opperate in a semi similier manner.
    That would be to easy. Some transmit the data as it is received no matter what the baud with out configuring (up to a point) and others can/need be configured.

    The data sheet you have does not help.
    Maybe Dave Houston will see this thread, he has a loot of experience with RF and maybe he has seen this one before.

    Is this what it looks like?
    http://www.sure-electronics.net/rf,a...-GC010_1_b.jpg
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    That's fairly sparse as far as a useful data sheet. (It's also a good example of why I don't purchase a module or component until after I've seen its data sheet!)

    Lacking more specific information, you can probably assume default channel, mode, and baud rate at startup. I wouldn't count on much of a buffer, so stick to 19,200 and try it that way.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  7. #7
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    (what I understand from the manual).
    http://www.sure-electronics.net/rf,audio/GP-GC010.pdf

    The baud rate is 19200. The module has a TX buffer of 64 bytes.
    When you send, the data (up to 64 bytes) is stored first in the
    TX buffer of the module and then, 10ms after that the last byte
    has been received, the data is automatically sent. The duration
    of the transmission depends on the quality of the RF link and the
    number of bytes that you have in the buffer. Use the "Busy" output
    to see when the transmission task has been completed and the buffer
    is ready to receive the next data packet.

    The word "customizable" probably means that you can order modules
    with a different baud rate in case your device is not able to
    use the baud rate 19200. (Probably a minimum quantity will apply
    for this special firmware).

    The module can use one of 64 channels. Make sure that both modules
    use the same channel.

    Best regards,

    Luciano
    Last edited by Luciano; - 20th October 2008 at 09:39.

  8. #8
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    That's the one alright!

    Thanks for all the input.
    I have managed to get these working, they will only work when the baud rate is set to 19200 and the DEFINE HSER_TXSTA must be set to 24h when working off a 4Mhz Crystal.

    Thanks

    Tony

  9. #9
    Join Date
    Jul 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Hello tonyfelloni

    I look for a similar wireless solution. What you say about this moduls? Work´s good? It's hard to use it? Have you a sample code that works that you can share?

    Thanks
    Best regards
    Pedro

  10. #10
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Hi Pedro

    The modules I used were cheap as chips and I have found them quite reliable...I would reccommend them all the way, the instructions are crap but the comments above are completely accurate and will iron out any issues you may have. You need to use a PIC that has a hardware USART such as 16F88 as the RF modules only run at a baud of 19,200 and with picbasic only the Harware USART can achieve this.

    Apart from that if you can't follow the instructions written by some asian dude in a language fit for a 12 year old get back here and ill try help you out with any problems u may have.

    Tony

  11. #11
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Luciano's analysis of the modules is 100% by the way.

    Tony

  12. #12
    Join Date
    Jul 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Hi tonyfelloni

    I will get 2 pieces to test it and if i have problems to run it i ask for your help

    Thank You

    Best regards
    Pedro
    Last edited by Pedro Santos; - 11th January 2009 at 14:32.

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


    Did you find this post helpful? Yes | No

    Default

    FYI. DEBUG can send serial data at 19200 with a 4MHz oscillator, and you can use most any I/O-pin.
    Code:
    @ DEVICE PIC16F627A, WDT_OFF, MCLR_OFF, LVP_OFF
    
    DEFINE OSC 4
    DEFINE DEBUG_REG PORTB
    DEFINE DEBUG_BIT 2
    DEFINE DEBUG_BAUD 19200 '38400
    DEFINE DEBUG_MODE 0 ' 1 = inverted, 0 = true
    
    Main:
        DEBUG "Testing 19200 bps @ 4MHz",13,10
        PAUSE 1000
        GOTO Main
    Regards,

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

  14. #14
    Join Date
    Jul 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Hello Bruce

    tonyfelloni said that it must use the hardwareUart from the pic. I not understand why.
    Perhaps a buffer problem why it not function with SoftUart?
    The modul hande up to 64 bytes, is this why must use the hardwareUart

    Regards
    Pedro

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


    Did you find this post helpful? Yes | No

    Default

    You need to use a PIC that has a hardware USART such as 16F88 as the RF modules only run at a baud of 19,200 and with picbasic only the Harware USART can achieve this.
    My guess would be he didn't know DEBUG would work at 19200.
    Regards,

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

  16. #16
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Correct, I wasnt aware of this....but now I know! :-)

    Cheers

  17. #17


    Did you find this post helpful? Yes | No

    Default

    Hello Tony,

    Could you please post an example on how to send and receive data with these modules?

    Thanks!

    Daniel.

  18. #18
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Hi Daniel

    Using these modules is the same as communicating between two pics if there was a wire connecting them.

    Below is the code the sending module is attached to, I have removed all unnecessary code and left all the defines etc so you can copy them exactly see if it works.

    Code:
    '****************************************************************
    '*  Name    : Sensirion SHT71.pbp                               *
    '*  Author  : Tony Flynn                                        *
    '*  Notice  : Copyright (c) Tony Flynn                          *
    '*          : All Rights Reserved                               *
    '*  Date    : 30/10/2008                                        *
    '*  Version : 7 - Code transmits TempC, TempF, RH & Time to     *
    '*            PICS on the network and serially to the PC        * 
    '*  Notes   :                                                   *
    '****************************************************************
    
    '-------------------------  Port Assignments --------------------------------
    
        ' PORTA.0   (02) Time flag pin from user interface, make pin input and pull to gnd (26)
        ' PORTA.1   (03) Serin time + all other settable parameters from User Interface (07) 
        ' PORTA.2   (04) Serout to PID Controller (17) 
        ' PORTA.3   (05) 
        ' PORTA.4   (06) 
        ' PORTA.5   (07) Serout to Ethernet - Must select HS OSC on this module &
        '                Ethernet PIC. Also non-inverted both sides. (38)  
        ' PORTB.0   (21) Interrupt Pin Square wave from DS1307 (07) 
        ' PORTB.1   (22) SHT11 SCK Clock Pin (03)  
        ' PORTB.2   (23) SHT11 Serial Data Pin (02) 
        ' PORTB.3   (24) RS232 Serial Out to PC (Obsolete, moved to PID) 
        ' PORTB.4   (25) Power Failure pin (Obsolete, moved to PID) 
        ' PORTB.5   (26) Hatch Status pin (Obsolete, moved to PID) 
        ' PORTB.6   (27) ICSP Pin 5
        ' PORTB.7   (28) ICSP Pin 4 
        ' PORTC.0   (11) 
        ' PORTC.1   (12) 
        ' PORTC.2   (13) 
        ' PORTC.3   (14) I2C Clock Line SCL DS1307 - 4k7 Pull up resistor (06) 
        ' PORTC.4   (15) I2C Data Line SDA DS1307 - 4k7 Pull up resistor (05)
        ' PORTC.5   (16)  
        ' PORTC.6   (17) USART TX Pin to wireless transceiver (03) 
        ' PORTC.7   (18) USART RX Pin
    
    '********************** 16F876A Configuration Fuses ****************************
     
    @ DEVICE HS_OSC
    ' Crystal Selected (High Speed is above 4MHz)
    @ DEVICE WDT_ON
    ' Watch Dog Timer is on - Needed for SLEEP command
    @ DEVICE PWRT_OFF
    ' Power Up Timer off, unit stays in reset for 72ms allowing Vdd to settle
    @ DEVICE BOD_ON
    ' Brown Out Detect on
    @ DEVICE LVP_OFF
    ' Low Voltage Programming off
    @ DEVICE CPD_OFF
    ' Data EEPROM code protection
    @ DEVICE WRT_OFF
    ' Write to Flash protection off
    @ DEVICE DEBUG_OFF
    ' On board Debugger off
    @ DEVICE PROTECT_OFF
    ' Protects code from being read from the chip
    
    
    '*******************************************************************************
    
    '--------------------------- Setup DEFINE's ----------------------------------
    
        include "modedefs.bas"      ' Contains Serout Baud rates
        DEFINE OSC 12               ' Using 12 MHz Oscillator
        DEFINE CHAR_PACING 1000     ' Pacing for serout Chars
        DEFINE HSER_RCSTA 90h       ' enable hardware serial port
        DEFINE HSER_TXSTA 24h       ' enable high speed transmit (Burgh=1)
        DEFINE HSER_BAUD 19200      ' set the baud rate for MIDI communications
        
    '------------------------  Port Initialization -------------------------------
    
        CCP1CON = %00000000         ' Disable CCP Module
        ADCON1 = %10000111          ' Set analog ports to digital mode, right justified
        CMCON = %00000111           ' Turn off comparator
        OPTION_REG.6 = 0            ' Interrupt on falling edge of RB0/INT pin
        OPTION_REG.7 = 0            ' PORTB Pullups enabled
        INTCON = %10010000          ' Global and RB0 Interrupts enabled
        TRISA = %000001
        TRISB = %00000111
        TRISC = %00000000
    
    '----------------------------------USART----------------------------------------
    
    USART:      ' Data sent to the wireless transceiver for remote module 
        pause 5   
        hserout [$55,$55,$55,$55,"TC",TempC.lowbyte,tempc.highbyte,TempF.lowbyte,TempF.highbyte,RHTempComp.lowbyte,RHTempComp.highbyte]
        Return
    Then the code on the receiving module is:

    Code:
    '****************************************************************
    '*  Name    : Monitoring Station - Rev 1                        *
    '*  Author  : Tony Flynn                                        *
    '*  Notice  : Copyright (c) 2008 Tony Flynn                     *
    '*          : All Rights Reserved                               *
    '*  Date    : 29/10/2008                                        *
    '*  Version : Rev 3 - Components removed for low power op       *
    '*  Notes   : Wireless minitoring station using 16F88 and       *
    '*            wireless module Cy2198TR. Data is displayed on    *
    '*            LCD. System operates at 4MHz. Data is beamed to   *
    '*            this module from other transceiver. Line into     *
    '*            other transceiver is non inverted USART from PIC  *
    '*            line into this PIC also non-inverted.  Unit is    *
    '*            Designed to run off 3 AA Alkaline batteries.      *
    '*                                                              *
    '****************************************************************
    
    
    '-------------------------  Port Assignments --------------------------------
    
    ' PORTA.0 (17)   LCD Data Line - Bit 4
    ' PORTA.1 (18)   LCD Data Line - Bit 5
    ' PORTA.2 (01)   LCD Data Line - Bit 6
    ' PORTA.3 (02)   LCD Data Line - Bit 7
    ' PORTA.4 (03)   LCD Data Line - Register Select - 10k pullup resistor to VDD
    ' PORTB.0 (06)   HPWM out to dim LCD light to off after X seconds
    ' PORTB.1 (07)   Button to turn on display for X time
    ' PORTB.2 (08)   Seiral Data in from wireless module. Wireless module voltage
    '                should be no greater than 1.5V less than MCU (5V). Tx from
    '                transceiver links directly to Rx of PIC.
    ' PORTB.3 (09)   LCD Data Line - Enable    
    ' PORTB.4 (10)   Wireless module Enable active low, High = low power mode.
    ' PORTB.5 (11)   Alarm Out pin   
    
    '************************ 16F88 Configuration Fuses ****************************
     
    @ DEVICE PROTECT_OFF
    @ DEVICE CCPMX_OFF
    @ DEVICE DEBUG_OFF
    @ DEVICE WRT_OFF
    @ DEVICE CPD_OFF
    @ DEVICE LVP_OFF
    @ DEVICE BOD_ON
    @ DEVICE MCLR_OFF
    @ DEVICE PWRT_ON
    @ DEVICE WDT_ON
    @ DEVICE XT_OSC
    @ DEVICE2 IESO_OFF 
    @ DEVICE FCMEN_ON
    
     
    ' Code Protection - _CP_OFF, CP_ON
    ' CCP1 Pin Selection - _CCP1_RB0, _CCP1_RB3
    ' In-Circuit Debugger Mode - _DEBUG_OFF, _DEBUG_ON
    ' Flash Program Memory Write Enable - _WRT_PROTECT_OFF, _WRT_PROTECT_256, _WRT_PROTECT_2048, _WRT_PROTECT_ALL
    ' Data EE Memory Code Protection - _CPD_OFF, _CPD_ON
    ' Low-Voltage Programming Enable - _LVP_OFF, _LVP_ON
    ' Brown-Out Reset - _BODEN_OFF, _BODEN_ON
    ' RA5/MCLR/Vpp Pin Function - _MCLR_OFF, _MCLR_ON
    ' Power-Up Timer - _PWRTE_OFF, _PWRTE_ON
    ' Watchdog Timer - _WDT_OFF, _WDT_ON
    ' Oscillator Selection - _EXTRC_CLKOUT, _EXTRC_IO, _INTRC_CLKOUT, _INTRC_IO, _EXTCLK, _HS_OSC, _XT_OSC, _LP_OSC 
    ' Oscillator Switchover - _IESO_OFF, _IESO_ON
    ' Fail-Safe Clock Monitor - _FCMEN_OFF, _FCMEN_ON
    
    '*******************************************************************************
    
    DEFINE OSC 4                    ' tell program we are using a 4mhz oscillator
    DEFINE HSER_RCSTA 90h           ' enable hardware serial port
    DEFINE HSER_TXSTA 24h           ' enable high speed transmit (Burgh=1)
    DEFINE HSER_BAUD 19200          ' set the baud rate for MIDI communications
    define HSER_CLROERR             ' Auto clear overflow buffer error.
    
        
        CCP1CON = %00000000         ' Disable CCP
        SSPCON.5 = 0                ' Disable SSP Module
        ANSEL = %00000000           ' Set analog ports to digital mode
        CMCON = %00000111           ' Turn off comparator    
        TRISA = %100000             ' Port A I/O Selection
        TRISB = %11110110   
    
    Display:
        low lowpower            ' Disable lower power operation
        pause 15                ' Give module time to wake
        Hserin[WAIT("TC"),TempC.lowbyte,tempc.highbyte,TempF.lowbyte,tempf.highbyte,RHTempComp.lowbyte,RHTempComp.highbyte]
        high lowpower           ' Set wireless tranceiver to low power mode

    I used the Hserin command as I could set this to the required baud. At the time I was unaware that the Debug option could be used. I am still using this setup today an it hasn't caused me any trouble at all.

    An initial problem I had was that the voltage on one of the modules was slightly on the low side and wasn't working. It worked fine once this was sorted. I havent used any inverters or the like. Serial data sent from the pin of one pic is fed into pin 3 (RX) of the wireless module through a 1k resistor, then on the other side pin 4 (TX) of the module is fed directly to the pic, no resistor.

    Hope this helps, it took me a while to get them going first!

    Tony

  19. #19


    Did you find this post helpful? Yes | No

    Default

    Thank you very much! I'll order these modules today, test them, and let you know.

    Daniel.

  20. #20


    Did you find this post helpful? Yes | No

    Default

    Hi Tony,

    One short question, on the eBay webpage it says:

    Running voltage: 2.2-5.4V

    On the PDF file it says:

    PIN1: VCC +2.4 to +4.2

    How many volts are you using to power up this RF module?

    Because getting 5 volts is easy, less volts it's a little more complicated.

    Thanks!

    Daniel.

  21. #21
    Join Date
    Jan 2008
    Location
    Dublin, Ireland
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Hi Danny

    I have mine powered from the 5 volt supply through 2 diodes
    these drop the voltage by about 0.6v each, works fine like this.

    Regards

    Tony

  22. #22


    Did you find this post helpful? Yes | No

    Default

    The modules I used were cheap as chips and I have found them quite reliable...I would recommend them all the way
    Well,

    i've been working with them all week with NO success!

    I've tried using DEBUG/DEBUGIN, SEROUT/SERIN and HSEROUT/HSERIN.

    I have 99% confidence in my code because it works when both pics are connected to each other.

    Using these modules just doesn't work and i'm out of solutions !

  23. #23


    Did you find this post helpful? Yes | No

    Default

    Did you try Tony's code? Are you using +2.4 to +4.2 volts to power it up?

  24. #24


    Did you find this post helpful? Yes | No

    Default

    Hello danielhr77,

    thank you for your support.

    Tony's code is just a sample and not the entire code, but Yes...i did tried the the Serin/Serout lines on my code and didnt worked!

    I'm using 4,24V on both RX and TX modules to power them up.

    Have you got these modules also ?
    Were you able to use them correctly ?

  25. #25


    Did you find this post helpful? Yes | No

    Default

    I bought them but I haven't tried them yet... Next month I'm going to test them with my application...

    I don't know if 4.24 volts is fine, maximum is 4.20 according to the manual, just in case to test, add a diode to reduce it a little.

    A few questions to rule things out:

    1) Are you enabling them? (pin 5 active low)
    2) Are you using a 1k resistor between the PIC and RX (pin 3)?

    That's all right now, it's 6:30 in the morning and I'm going to bed...

  26. #26


    Did you find this post helpful? Yes | No

    Default

    Hi danielhr77,

    Followed your guide lines...

    add a diode to reduce it a little.
    Done...result is the same

    1) Are you enabling them? (pin 5 active low)
    Yes...i'm using pin5 low

    2) Are you using a 1k resistor between the PIC and RX (pin 3)?
    I wasnt...but i just tested this also and the result is the same

    Also, i programmed on both modules the channel like:
    Code:
    DEBUG $af, $20
    If you remember any other pointer for me to check i will be gratefull

    My best regards

  27. #27


    Did you find this post helpful? Yes | No

    Default

    Hmm... Do you have the correct baudrate? There's nothing else I can think of, maybe Tony has more ideas...

  28. #28


    Did you find this post helpful? Yes | No

    Default

    Yes...19200 on both

    I'm too without ideas.

    If someone has any suggestions i would be gratefull.

  29. #29
    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
    Also, i programmed on both modules the channel like:
    Code:
    DEBUG $af, $20
    Did you Pull pin 8 low before sending data and return it to High after? And did the module respond the way the Almost_A_Data sheet said ?
    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.

  30. #30


    Did you find this post helpful? Yes | No

    Default

    Hi Joe S. and thanks for your help,

    Yes i did...I have a led connected to each one. The modules ( after sending the channel number ) light up the leds for a second confirming the channel change.

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


    Did you find this post helpful? Yes | No

    Default

    Are you using a max232 or similar between the transceiver and the PC or between the other transceiver and the PIC ? The PIC operates in the 8N1 True mode and should have a pull up resistor on it's line, whereas the PC operates in the 8N1 Inverted mode and requires a level shifter to make it true.
    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.

  32. #32


    Did you find this post helpful? Yes | No

    Default

    Hi Joe S.,

    the modules are connected directly to the pics.

    One thing i noticed and i found it weird is that when turning the power on the receiver ( and always the RX - never happened to the TX ) sometimes does not start receiving ( although the TX is transmitting ).

    My workaround is to turn power off for a couple of seconds and reconnect power ( and sometimes i have to do this 2 or 3 times ).

    I changed modules, experiment board, etc and this only happens on the RX side.

    Should it be any startup procedure sequence for the RX ?

  33. #33
    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
    I changed modules, experiment board, etc and this only happens on the RX side.

    Should it be any startup procedure sequence for the RX ?
    Not sure if you mean the PIC or the transceiver. The PIC RX using HSERIN <font color=red>REQUIRES a pullup to VDD </font color>or you will get an intermittent (if at all) PIC boot. If this causes problems with the radio, you can use something to buffer the link, Tristate buffer ? I discovered this a long time back with my serial LCD project. You could "buffer" it with a simple transistor, but would then be dealing with inverted serial data.
    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.

  34. #34


    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.

  35. #35
    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 &micro;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.

  36. #36


    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

  37. #37
    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.

  38. #38


    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

  39. #39
    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.

  40. #40


    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