problem with sending data using RF module


Closed Thread
Results 1 to 40 of 52

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hello rano_zen06,
    Looking at your code . . . not however, trying it out . . . Is this all of it? I do not see anything to cause the transmitter to send data from the keypad, unless I have become legally blind . . . or stupid . . . that is why I asked is this all of it. As I said . . I see empty variables in the serout routine.
    Code:
     SEROUT TransmitterPIN,T2400,[Synk,Synk,9,Counter]
    I would try adding a string to the serout routine for test purposes only, something like
    Code:
    SEROUT TransmitterPIN,T2400,$FE,1,["1 2 3 "]
    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.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Joe, seems you missed the underlined section...
    Code:
    Main:
    HIGH LEDPin
    PAUSE 100
    LOW LEDPin
    PAUSE 100
    
    SEROUT TransmitterPIN,T9600,[Synk,Synk,Synk,Synk,Synk,Synk,9,Counter]
    
    HIGH LEDPin
    PAUSE 100
    LOW LEDPin
    PAUSE 100
    
    Counter = Counter + 1
    PAUSE 600
    GOTO Main
    END
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Maybe Joe has bifocals like me
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    As drawn, both Reset switches are shorting +5V to GND.

    Can you provide details for your transmitter and receiver module
    manufactiurer/model/pinouts?

    See http://davehouston.org/RFTipsTricks.htm
    Sorry for late reply guys,got a lot of homeworks to do. ; )
    The fact is I have less information about my RF module.I just buy it from the nearest electronic store.Since I live here in Chiang Mai ,Thailand...It's hard for me to find a good types of RF module such as PArallax or TWS/RWS 434...For your reference I attach the picture of the RF modules .The link below may help. It was the datasheet of receiver chip used in my RF module.
    http://www.himark.com.tw/images/pdf/...df/RX3310A.zip


    Quote Originally Posted by Joe S. View Post
    Hello rano_zen06,
    Looking at your code . . . not however, trying it out . . . Is this all of it? I do not see anything to cause the transmitter to send data from the keypad, unless I have become legally blind . . . or stupid . . . that is why I asked is this all of it. As I said . . I see empty variables in the serout routine.
    Code:
     SEROUT TransmitterPIN,T2400,[Synk,Synk,9,Counter]
    I would try adding a string to the serout routine for test purposes only, something like
    Code:
    SEROUT TransmitterPIN,T2400,$FE,1,["1 2 3 "]
    Actually what I want to do right now is display the counting numbers on my LCD at receiver board and it's nothing to do with my keypad.I just want to try send a data using my RF module first before I proceed with sending the data from my scanning keypad because I need to know if my RF module able to do it's job or not.

    Quote Originally Posted by mister_e View Post
    See pics in POST#1. 16F877A, and seems ADCON1 and CMCON settings are right.

    Once the wire connection will work, i may suspect 2 other things.
    1)open collector output of the receiver
    2)use inverted mode instead. so the pin will idle low.
    I already connect the Transmitter and the receiver pin directly but it's not work.my LCD only shows a bunch of black box .Maybe the major problem is from my coding or hardware??
    Any other suggestion mister_e ? and how to use inverted mode??
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    LCD only shows a bunch of black box
    PIN 3 on the LCD is for contrast. Hook a pot up as a voltage divider with the wiper going to display pin #3. Then adjust until the black boxes go away. Then try sending "HELLO WORLD" to the display.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi, try a direct connection (porta to porta) with following. And of course don't forget to connect the Transmitter board GND with the Receiver board GND.

    Receiver
    Code:
            @       __CONFIG _HS_OSC & _LVP_OFF
            define OSC 20
            
            DEFINE LCD_DREG PORTC 'LCD data port
            DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
            DEFINE LCD_RSREG PORTB 'LCD register select port
            DEFINE LCD_RSBIT 7 'LCD register select bit
            DEFINE LCD_EREG PORTB 'LCD enable port
            DEFINE LCD_EBIT 5 'LCD enable bit
            DEFINE LCD_RWREG PORTB 'LCD read/write port
            DEFINE LCD_RWBIT 6 'LCD read/write bit
            DEFINE LCD_BITS 8 'LCD bus size 4 or 8
            DEFINE LCD_LINES 2 'Number lines on LCD
            DEFINE LCD_COMMANDUS 2000 'Command delay time in us
            DEFINE LCD_DATAUS 50 'Data delay time in us
            
            TRISC = %00000000 'Set port B as output
            TRISB = %00000000 'Set port D as output
            low PORTB.6 'Set the R/W bit to low
            
            pause 1000 'wait until the LCD initializes
            
            INCLUDE "modedefs.bas"
            Counter VAR BYTE
            ReciverPIN VAR PORTA.0
            ADCON1 = 7 ' Alla digitala
            PAUSE 500
    
    Main:
            SERIN ReciverPIN,T2400,[9],Counter
            GOSUB LCD
            GOTO Main
    
    LCD:
            LCDOUT $FE,1
            LCDOUT $FE,$80,#Counter
            PAUSE 500
            RETURN
    
            END
    Transmitter
    Code:
            @       __CONFIG _HS_OSC & _LVP_OFF
            DEFINE OSC 20
            ADCON1=7
            ;CMCON = 7 'Alla I/O Digitala
            LEDPin VAR PORTB.4
            TransmitterPIN VAR PORTA.0
            INCLUDE "modedefs.bas"
            Counter VAR BYTE
            Synk VAR BYTE
            Synk = $55
            DEFINE CHAR_PACING 500
            Counter = 0
            
            HIGH TransmitterPin
            pause 200
    
    Main:
            HIGH LEDPin
            PAUSE 100
            LOW LEDPin
            PAUSE 100
            SEROUT TransmitterPIN,T2400,[Synk,Synk,9,Counter]
            HIGH LEDPin
            PAUSE 100
            LOW LEDPin
            PAUSE 100
            
            Counter = Counter + 1
            PAUSE 600
            GOTO Main
            END
    If you want to switch to the inverted mode, you just need to change T2400 to N2400, and the HIGH TransmitterPIN to LOW TransmitterPIN.

    Work just fine here.

    Unfortunately your picture don't help... it's a bit fuzzy
    Last edited by mister_e; - 2nd April 2008 at 19:46.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Arrow

    Quote Originally Posted by mackrackit View Post
    PIN 3 on the LCD is for contrast. Hook a pot up as a voltage divider with the wiper going to display pin #3. Then adjust until the black boxes go away. Then try sending "HELLO WORLD" to the display.
    thanks for the advice mackrackit.I've tested my LCD before and I found nothing's wrong with it.Even I connect pin 3 directly to the ground, my LCD still can display variable words clearly.

    Quote Originally Posted by mister_e View Post
    Hi, try a direct connection (porta to porta) with following. And of course don't forget to connect the Transmitter board GND with the Receiver board GND.

    Receiver
    Code:
            @       __CONFIG _HS_OSC & _LVP_OFF
            define OSC 20
            
            DEFINE LCD_DREG PORTC 'LCD data port
            DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
            DEFINE LCD_RSREG PORTB 'LCD register select port
            DEFINE LCD_RSBIT 7 'LCD register select bit
            DEFINE LCD_EREG PORTB 'LCD enable port
            DEFINE LCD_EBIT 5 'LCD enable bit
            DEFINE LCD_RWREG PORTB 'LCD read/write port
            DEFINE LCD_RWBIT 6 'LCD read/write bit
            DEFINE LCD_BITS 8 'LCD bus size 4 or 8
            DEFINE LCD_LINES 2 'Number lines on LCD
            DEFINE LCD_COMMANDUS 2000 'Command delay time in us
            DEFINE LCD_DATAUS 50 'Data delay time in us
            
            TRISC = %00000000 'Set port B as output
            TRISB = %00000000 'Set port D as output
            low PORTB.6 'Set the R/W bit to low
            
            pause 1000 'wait until the LCD initializes
            
            INCLUDE "modedefs.bas"
            Counter VAR BYTE
            ReciverPIN VAR PORTA.0
            ADCON1 = 7 ' Alla digitala
            PAUSE 500
    
    Main:
            SERIN ReciverPIN,T2400,[9],Counter
            GOSUB LCD
            GOTO Main
    
    LCD:
            LCDOUT $FE,1
            LCDOUT $FE,$80,#Counter
            PAUSE 500
            RETURN
    
            END
    Transmitter
    Code:
            @       __CONFIG _HS_OSC & _LVP_OFF
            DEFINE OSC 20
            ADCON1=7
            ;CMCON = 7 'Alla I/O Digitala
            LEDPin VAR PORTB.4
            TransmitterPIN VAR PORTA.0
            INCLUDE "modedefs.bas"
            Counter VAR BYTE
            Synk VAR BYTE
            Synk = $55
            DEFINE CHAR_PACING 500
            Counter = 0
            
            HIGH TransmitterPin
            pause 200
    
    Main:
            HIGH LEDPin
            PAUSE 100
            LOW LEDPin
            PAUSE 100
            SEROUT TransmitterPIN,T2400,[Synk,Synk,9,Counter]
            HIGH LEDPin
            PAUSE 100
            LOW LEDPin
            PAUSE 100
            
            Counter = Counter + 1
            PAUSE 600
            GOTO Main
            END
    If you want to switch to the inverted mode, you just need to change T2400 to N2400, and the HIGH TransmitterPIN to LOW TransmitterPIN.

    Work just fine here.

    Unfortunately your picture don't help... it's a bit fuzzy
    hi mister_e, I feel very sorry about the picture quality. I will attach the better one soon. Just try the code above but the error occur when I try to compile it using my microcode studio and it says " Error TRANSM~1.ASM 94 : [235] opcode expected instead of '0' "
    After remove ' & _LVP_OFF ', microcode studio compile it succesfully.
    The code works fine when I connect my transmitter and receiver pin directly and I can see the counting number display on my LCD.but It only works once when I try it using my RF modules.I got no result after try it the 2nd time.Only static number ( noise) shows up on my LCD.How do i reduce the noise??

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    There's a long long long way in between, i think you could try the Inverted mode first and then slow the baudrate, say 300bauds.

    You should have a decent distance between the transmitter and receiver ... i think over 3 feets could be enough. Now , i don't know the RF receiver you have, but it's possible that it's output is an open-collector type. I would suggest you to add a 10K pull-up resistor between Vcc and RA.0 to see if it works better.

    If you have any Scope, in the transmitter code, do a loop with SEROUT TransmitterPIN,N2400,[Synk] monitor the RF module output to see how good, bad the signal is.

    On the transmitter AND the receiver module, use a 10-22uF tantalum+0.1uF as close as possible of your rf module. Same thing for your PICs. Try to sit your RF module away of your PICs.

    You can also try to add 1-2 more Synk character at the begining of your transmission. For 1-2 bytes of data you shouldn't need any encoding/decoding even if.

    Begin with it and see what happen. Without any spec of your module, it's a bit hard. Hope you have a scope
    <hr>
    For the compilation error, i used MPASM config fuse syntax, PM will use the following.
    Code:
    @      device HS_OSC, LVP_OFF
    Last edited by mister_e; - 3rd April 2008 at 16:08.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I'll also suggest you to follow Dave's post
    http://www.picbasic.co.uk/forum/show...79&postcount=9

    If the transmitter output signal is a bit messy, you will need to 'shape it'. Probably the internal comparator could be used here..
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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