Wireless using debug.


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52

    Default Wireless using debug.

    I got a couple of RF modules from Rentron to experiment with.
    I'm using debug on the transmit side to send the data.
    The problem is it will send the data to the LCD and display it momentarily then continue sending garbage to the LCD.
    I know I need some kind of software filtering but I don't know where to start.
    Any examples would be appreciated.
    Here is what I'm sending directly to the transmitter:

    Code:
    debug $FE,$1           
    pause 100
    debug $FE,$80+0,"PV volts:          ",$FE,$80+13,dec(PV/10),".",dec(PV//10)," "
    debug $FE, $C0, "Batt volts:        ",$FE,$C0+13,dec(Batt/10),".",dec(Batt//10)," "
    debug $FE, $94, "Batt Curr:         ",$FE,$94+13,dec(gridcurr/10),".",dec(gridcurr//10)," "
    debug $FE, $D4, "Grid Curr:         ",$FE,$D4+13,dec(battcurr/10),".",dec(battcurr//10)," "
    On the receiving end here is how it is being received then sent to a 4x20 serial LCD:

    Code:
    mainloop:
      Serin rcv, mode, char   ' Get a char from serial input
           Lcdout char                 ' Send char to display
           Goto mainloop              
     End
    Edit/Delete Message

  2. #2
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Still fighting this thing. I've changed it serout2 and serin2 with a synch character but still no luck. It will work with lots of noise with the wait & synch character removed.
    I'm pretty sure the problem is on the recieving end.
    HELP!!


    Transmitting pic

    Code:
    MAIN:                           
            serout2 PORTB.5,16780,[junk,synch,$FE,$1]  'Clear screen and home
            serout2 PORTB.5,16780,[junk,synch,$FE,$0F] 'Display on, cursor on
            serout2 PORTB.5,16780,[junk,synch,$FE,$80,"LCD Line 1"]
            serout2 PORTB.5,16780,[junk,synch,$FE,$C0,"LCD Line 2"]
            serout2 PORTB.5,16780,[junk,synch,$FE,$94,"LCD Line 3"]
            serout2 PORTB.5,16780,[junk,synch,$FE,$D4,"LCD Line 4"]
        
        for K=1 to 2            'Delay in seconds 65534 max
            pause 1000         '1 second delay 
        next k         
    
    GOTO MAIN
    end

    Recieving pic

    Code:
    MAIN:
    Serin2 rcv,mode,[WAIT("A"),char]   ' Get a char from serial input
           Lcdout char                         ' Send char to display
    Goto MAIN              
    End

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


    Did you find this post helpful? Yes | No

    Default

    This may or may not help
    http://www.picbasic.co.uk/forum/show...9&postcount=26
    You may want to read the whole thread....
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    This may or may not help
    http://www.picbasic.co.uk/forum/show...9&postcount=26
    You may want to read the whole thread....
    Yeah...Ummmm.
    That thread is really confusing.

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


    Did you find this post helpful? Yes | No

    Default

    The thread is a bit confusing, but the post I linked you to has working code.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    The thread is a bit confusing, but the post I linked you to has working code.
    Well sort of. It prints the 9 which is supposed to be the sync byte followed by the 3 (93) but only if connected by a wire.
    Isn't it supposed to just print the character following the sync byte?
    Also it won't do anything if sent wirelessly.
    I know my wireless modules work because I can send data followed by trash with the first code above.
    Just can't get rid of the trash and I do have a ground plane on both ends.
    Bruce said that it was hard to make them work properly but surely someone has a simple code to transmit and recieve string and data.
    I wanted to use debug but it isn't as simple as it sounded in my head..

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


    Did you find this post helpful? Yes | No

    Default

    TIP: If you're sending long strings of data, first receive the whole string, then print it on
    the LCD.

    Receiving a single byte after the "A", then printing it on the LCD, you're missing a TON of
    serial data during LCDOUT. And you only have 1 synch character at the start of each
    string.

    Also ... give the receiving end time to place everything on the LCD before sending the next
    string. Imagine someone handing you ten gallon buckets of water every 2 seconds, with
    you having to pour it through a straw into another bucket, and trying to keep up...;o)
    Regards,

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

Similar Threads

  1. N-Bit_MATH
    By Darrel Taylor in forum Code Examples
    Replies: 38
    Last Post: - 16th December 2010, 14:48
  2. About USB
    By dias11 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd December 2009, 20:41
  3. debug not working with MPASM assempler
    By santamaria in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th March 2009, 07:51
  4. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46
  5. Need help with debug
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2008, 06:37

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